當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。