本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.setActiveTexture方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.setActiveTexture方法的具體用法?Java GlStateManager.setActiveTexture怎麽用?Java GlStateManager.setActiveTexture使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.setActiveTexture方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: endShader
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void endShader()
{
OpenGlHelper.glUseProgram(0);
currentProgram = -1;
staticShaderManager = null;
lastCull = true;
for (int i = 0; i < this.shaderSamplerLocations.size(); ++i)
{
if (this.shaderSamplers.get(this.samplerNames.get(i)) != null)
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i);
GlStateManager.bindTexture(0);
}
}
}
示例2: bindTextures
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void bindTextures(MultiTexID multiTex)
{
boundTex = multiTex;
if (Shaders.isRenderingWorld && GlStateManager.getActiveTextureUnit() == 33984)
{
if (Shaders.configNormalMap)
{
GlStateManager.setActiveTexture(33986);
GlStateManager.bindTexture(multiTex.norm);
}
if (Shaders.configSpecularMap)
{
GlStateManager.setActiveTexture(33987);
GlStateManager.bindTexture(multiTex.spec);
}
GlStateManager.setActiveTexture(33984);
}
GlStateManager.bindTexture(multiTex.base);
}
示例3: beginWeather
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void beginWeather()
{
if (!isShadowPass)
{
if (usedDepthBuffers >= 3)
{
GlStateManager.setActiveTexture(33996);
GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, renderWidth, renderHeight);
GlStateManager.setActiveTexture(33984);
}
GlStateManager.enableDepth();
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.enableAlpha();
useProgram(20);
}
}
示例4: endShader
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void endShader()
{
OpenGlHelper.glUseProgram(0);
currentProgram = -1;
staticShaderManager = null;
field_148000_e = true;
for (int i = 0; i < this.shaderSamplerLocations.size(); ++i)
{
if (this.shaderSamplers.get(this.samplerNames.get(i)) != null)
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i);
GlStateManager.bindTexture(0);
}
}
}
示例5: beginTranslucent
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void beginTranslucent()
{
if (Shaders.isRenderingWorld)
{
if (Shaders.usedDepthBuffers >= 2)
{
GlStateManager.setActiveTexture(33995);
Shaders.checkGLError("pre copy depth");
GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, Shaders.renderWidth, Shaders.renderHeight);
Shaders.checkGLError("copy depth");
GlStateManager.setActiveTexture(33984);
}
Shaders.useProgram(12);
}
}
示例6: unsetBrightness
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected void unsetBrightness()
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.defaultTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PRIMARY_COLOR);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.defaultTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_ALPHA, OpenGlHelper.GL_PRIMARY_COLOR);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_ALPHA, 770);
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, 5890);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, 5890);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.setActiveTexture(OpenGlHelper.GL_TEXTURE2);
GlStateManager.disableTexture2D();
GlStateManager.bindTexture(0);
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, 5890);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, 5890);
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
示例7: drawEntityOnScreen
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void drawEntityOnScreen(int posX, int posY, int scale, EntityLivingBase ent) {
GlStateManager.enableColorMaterial();
GlStateManager.pushMatrix();
GlStateManager.translate(posX, posY, 50.0F);
GlStateManager.scale((-scale), scale, scale);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
float f = ent.renderYawOffset;
float f1 = ent.rotationYaw;
float f2 = ent.rotationPitch;
float f3 = ent.prevRotationYawHead;
float f4 = ent.rotationYawHead;
GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
RenderHelper.enableStandardItemLighting();
GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
ent.renderYawOffset = 0;
ent.rotationYaw = 0;
ent.rotationPitch = 0;
ent.rotationYawHead = ent.rotationYaw;
ent.prevRotationYawHead = ent.rotationYaw;
GlStateManager.translate(0.0F, 0.0F, 0.0F);
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.setPlayerViewY(180.0F);
rendermanager.setRenderShadow(false);
rendermanager.doRenderEntity(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
rendermanager.setRenderShadow(true);
ent.renderYawOffset = f;
ent.rotationYaw = f1;
ent.rotationPitch = f2;
ent.prevRotationYawHead = f3;
ent.rotationYawHead = f4;
GlStateManager.popMatrix();
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
示例8: bindNSTextures
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void bindNSTextures(int normTex, int specTex)
{
if (Shaders.isRenderingWorld && GlStateManager.getActiveTextureUnit() == 33984)
{
GlStateManager.setActiveTexture(33986);
GlStateManager.bindTexture(normTex);
GlStateManager.setActiveTexture(33987);
GlStateManager.bindTexture(specTex);
GlStateManager.setActiveTexture(33984);
}
}
示例9: unsetScoreTeamColor
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected void unsetScoreTeamColor()
{
GlStateManager.enableLighting();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
示例10: setScoreTeamColor
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected boolean setScoreTeamColor(T entityLivingBaseIn)
{
GlStateManager.disableLighting();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
return true;
}
示例11: setBrightness
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected boolean setBrightness(T entitylivingbaseIn, float partialTicks, boolean combineTextures)
{
float f = entitylivingbaseIn.getBrightness(partialTicks);
int i = this.getColorMultiplier(entitylivingbaseIn, f, partialTicks);
boolean flag = (i >> 24 & 255) > 0;
boolean flag1 = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0;
if (!flag && !flag1)
{
return false;
}
else if (!flag && !combineTextures)
{
return false;
}
else
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.defaultTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PRIMARY_COLOR);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 7681);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.defaultTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, OpenGlHelper.GL_INTERPOLATE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.GL_CONSTANT);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE2_RGB, OpenGlHelper.GL_CONSTANT);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND2_RGB, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 7681);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
this.brightnessBuffer.position(0);
if (flag1)
{
this.brightnessBuffer.put(1.0F);
this.brightnessBuffer.put(0.0F);
this.brightnessBuffer.put(0.0F);
this.brightnessBuffer.put(0.3F);
}
else
{
float f1 = (float)(i >> 24 & 255) / 255.0F;
float f2 = (float)(i >> 16 & 255) / 255.0F;
float f3 = (float)(i >> 8 & 255) / 255.0F;
float f4 = (float)(i & 255) / 255.0F;
this.brightnessBuffer.put(f2);
this.brightnessBuffer.put(f3);
this.brightnessBuffer.put(f4);
this.brightnessBuffer.put(1.0F - f1);
}
this.brightnessBuffer.flip();
GlStateManager.glTexEnv(8960, 8705, this.brightnessBuffer);
GlStateManager.setActiveTexture(OpenGlHelper.GL_TEXTURE2);
GlStateManager.enableTexture2D();
GlStateManager.bindTexture(TEXTURE_BRIGHTNESS.getGlTextureId());
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.lightmapTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 7681);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
return true;
}
}
示例12: unsetBrightness
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected void unsetBrightness()
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.defaultTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PRIMARY_COLOR);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.defaultTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_ALPHA, OpenGlHelper.GL_PRIMARY_COLOR);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_ALPHA, 770);
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, 5890);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, 5890);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.setActiveTexture(OpenGlHelper.GL_TEXTURE2);
GlStateManager.disableTexture2D();
GlStateManager.bindTexture(0);
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, 5890);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, 5890);
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
if (Config.isShaders())
{
Shaders.setEntityColor(0.0F, 0.0F, 0.0F, 0.0F);
}
}
示例13: updateSubImage
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void updateSubImage(MultiTexID multiTex, int[] src, int width, int height, int posX, int posY, boolean linear, boolean clamp)
{
int i = width * height;
IntBuffer intbuffer = getIntBuffer(i);
intbuffer.clear();
intbuffer.put(src, 0, i);
intbuffer.position(0).limit(i);
GlStateManager.bindTexture(multiTex.base);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);
if (src.length == i * 3)
{
intbuffer.clear();
intbuffer.put(src, i, i).position(0);
intbuffer.position(0).limit(i);
}
GlStateManager.bindTexture(multiTex.norm);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);
if (src.length == i * 3)
{
intbuffer.clear();
intbuffer.put(src, i * 2, i);
intbuffer.position(0).limit(i);
}
GlStateManager.bindTexture(multiTex.spec);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);
GlStateManager.setActiveTexture(33984);
}
示例14: glDraw
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void glDraw() {
GlStateManager.enableColorMaterial();
GlStateManager.pushMatrix();
GlStateManager.translate(entityX, entityY, 50.0F);
//GlStateManager.translate((float)x, (float)y, 50.0F);
GlStateManager.scale((float) (-scale), (float) scale, (float) scale);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
//GlStateManager.rotate(-100.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(0.0f, 1.0F, 0.0F, 0.0F);
//GlStateManager.rotate(-((float)Math.atan((double)(-mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
//RenderHelper.enableStandardItemLighting();
entity.renderYawOffset = (float)Math.atan((double)(-mouseX / 40.0F)) * 40.0F;
entity.rotationYaw = (float)Math.atan((double)(-mouseX / 40.0F)) * 40.0F;
entity.rotationPitch = -((float)Math.atan((double)(-mouseY / 40.0F))) * 40.0F;
entity.rotationPitch = reduce(entity.rotationPitch);
entity.rotationYaw = reduce(entity.rotationYaw);
entity.renderYawOffset = reduce(entity.renderYawOffset);
entity.rotationYawHead = entity.rotationYaw;
entity.prevRotationYawHead = entity.rotationYaw;
GlStateManager.translate(0.0F, 0.0F, 0.0F);
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.setPlayerViewY(180.0F);
rendermanager.setRenderShadow(false);
GlStateManager.enableLighting();
for(int i = 0; i < 8; i++){
GlStateManager.disableLight(i);
}
rendermanager.doRenderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
rendermanager.setRenderShadow(true);
GlStateManager.popMatrix();
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
示例15: useShader
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void useShader()
{
this.isDirty = false;
staticShaderManager = this;
this.field_148016_p.func_148109_a();
if (this.program != currentProgram)
{
OpenGlHelper.glUseProgram(this.program);
currentProgram = this.program;
}
if (this.useFaceCulling)
{
GlStateManager.enableCull();
}
else
{
GlStateManager.disableCull();
}
for (int i = 0; i < this.shaderSamplerLocations.size(); ++i)
{
if (this.shaderSamplers.get(this.samplerNames.get(i)) != null)
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i);
GlStateManager.enableTexture2D();
Object object = this.shaderSamplers.get(this.samplerNames.get(i));
int j = -1;
if (object instanceof Framebuffer)
{
j = ((Framebuffer)object).framebufferTexture;
}
else if (object instanceof ITextureObject)
{
j = ((ITextureObject)object).getGlTextureId();
}
else if (object instanceof Integer)
{
j = ((Integer)object).intValue();
}
if (j != -1)
{
GlStateManager.bindTexture(j);
OpenGlHelper.glUniform1i(OpenGlHelper.glGetUniformLocation(this.program, (CharSequence)this.samplerNames.get(i)), i);
}
}
}
for (ShaderUniform shaderuniform : this.shaderUniforms)
{
shaderuniform.upload();
}
}