当前位置: 首页>>代码示例>>Java>>正文


Java GlStateManager.glCopyTexSubImage2D方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.glCopyTexSubImage2D方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.glCopyTexSubImage2D方法的具体用法?Java GlStateManager.glCopyTexSubImage2D怎么用?Java GlStateManager.glCopyTexSubImage2D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.GlStateManager的用法示例。


在下文中一共展示了GlStateManager.glCopyTexSubImage2D方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: rotateAndBlurSkybox

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Rotate and blurs the skybox view in the main menu
 */
private void rotateAndBlurSkybox(float partialTicks)
{
    this.mc.getTextureManager().bindTexture(this.backgroundTexture);
    GlStateManager.glTexParameteri(3553, 10241, 9729);
    GlStateManager.glTexParameteri(3553, 10240, 9729);
    GlStateManager.glCopyTexSubImage2D(3553, 0, 0, 0, 0, 0, 256, 256);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.colorMask(true, true, true, false);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    GlStateManager.disableAlpha();
    int i = 3;

    for (int j = 0; j < 3; ++j)
    {
        float f = 1.0F / (float)(j + 1);
        int k = this.width;
        int l = this.height;
        float f1 = (float)(j - 1) / 256.0F;
        vertexbuffer.pos((double)k, (double)l, (double)this.zLevel).tex((double)(0.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        vertexbuffer.pos((double)k, 0.0D, (double)this.zLevel).tex((double)(1.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        vertexbuffer.pos(0.0D, 0.0D, (double)this.zLevel).tex((double)(1.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        vertexbuffer.pos(0.0D, (double)l, (double)this.zLevel).tex((double)(0.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
    }

    tessellator.draw();
    GlStateManager.enableAlpha();
    GlStateManager.colorMask(true, true, true, true);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:35,代码来源:GuiMainMenu.java

示例2: rotateAndBlurSkybox

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Rotate and blurs the skybox view in the main menu
 */
private void rotateAndBlurSkybox(float partialTicks) {
	this.mc.getTextureManager().bindTexture(this.backgroundTexture);
	GlStateManager.glTexParameteri(3553, 10241, 9729);
	GlStateManager.glTexParameteri(3553, 10240, 9729);
	GlStateManager.glCopyTexSubImage2D(3553, 0, 0, 0, 0, 0, 256, 256);
	GlStateManager.enableBlend();
	GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
			GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
			GlStateManager.DestFactor.ZERO);
	GlStateManager.colorMask(true, true, true, false);
	Tessellator tessellator = Tessellator.getInstance();
	VertexBuffer vertexbuffer = tessellator.getBuffer();
	vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
	GlStateManager.disableAlpha();
	int i = 3;
	int j = 3;
	CustomPanoramaProperties custompanoramaproperties = CustomPanorama.getCustomPanoramaProperties();

	if (custompanoramaproperties != null) {
		j = custompanoramaproperties.getBlur2();
	}

	for (int k = 0; k < j; ++k) {
		float f = 1.0F / (float) (k + 1);
		int l = this.width;
		int i1 = this.height;
		float f1 = (float) (k - 1) / 256.0F;
		vertexbuffer.pos((double) l, (double) i1, (double) this.zLevel).tex((double) (0.0F + f1), 1.0D)
				.color(1.0F, 1.0F, 1.0F, f).endVertex();
		vertexbuffer.pos((double) l, 0.0D, (double) this.zLevel).tex((double) (1.0F + f1), 1.0D)
				.color(1.0F, 1.0F, 1.0F, f).endVertex();
		vertexbuffer.pos(0.0D, 0.0D, (double) this.zLevel).tex((double) (1.0F + f1), 0.0D)
				.color(1.0F, 1.0F, 1.0F, f).endVertex();
		vertexbuffer.pos(0.0D, (double) i1, (double) this.zLevel).tex((double) (0.0F + f1), 0.0D)
				.color(1.0F, 1.0F, 1.0F, f).endVertex();
	}

	tessellator.draw();
	GlStateManager.enableAlpha();
	GlStateManager.colorMask(true, true, true, true);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:45,代码来源:GuiMainMenu.java


注:本文中的net.minecraft.client.renderer.GlStateManager.glCopyTexSubImage2D方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。