本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.enableCull方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.enableCull方法的具体用法?Java GlStateManager.enableCull怎么用?Java GlStateManager.enableCull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.enableCull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void doRenderLayer(EntityPlayer entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
GlStateManager.pushMatrix();
GlStateManager.disableCull();
//GlStateManager.enableAlpha();
//GlStateManager.depthMask(true);
//GlStateManager.disableRescaleNormal();
//GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
//GlStateManager.enableTexture2D();
Minecraft.getMinecraft().getTextureManager().bindTexture(ENDERMAN_TEXTURES);
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
endermanModel.isCarrying = false;
endermanModel.isAttacking = false;
endermanModel.bipedHead.offsetY = 0.25F;
endermanModel.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.translate(0.5F, 0.0F, 0.5F);
//GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableCull();
GlStateManager.popMatrix();
}
示例2: renderShulkerBox
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void renderShulkerBox(int color, float lidProgress) {
GlStateManager.enableDepth();
GlStateManager.depthFunc(515);
GlStateManager.depthMask(true);
GlStateManager.disableCull();
RenderUtils.bindTexture(RenderShulker.SHULKER_ENDERGOLEM_TEXTURE[color]);
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.translate(0 + 0.5F, 0 + 1.5F, 0 + 0.5F);
GlStateManager.scale(1.0F, -1.0F, -1.0F);
GlStateManager.translate(0.0F, 1.0F, 0.0F);
GlStateManager.scale(0.9995F, 0.9995F, 0.9995F);
GlStateManager.translate(0.0F, -1.0F, 0.0F);
SHULKER_BOX_MODEL.base.render(0.0625F);
GlStateManager.translate(0.0F, -lidProgress * 0.5F, 0.0F);
GlStateManager.rotate(270.0F * lidProgress, 0.0F, 1.0F, 0.0F);
SHULKER_BOX_MODEL.lid.render(0.0625F);
GlStateManager.enableCull();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例3: renderCrystalBeams
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void renderCrystalBeams(double p_188325_0_, double p_188325_2_, double p_188325_4_, float p_188325_6_, double p_188325_7_, double p_188325_9_, double p_188325_11_, int p_188325_13_, double p_188325_14_, double p_188325_16_, double p_188325_18_)
{
float f = (float)(p_188325_14_ - p_188325_7_);
float f1 = (float)(p_188325_16_ - 1.0D - p_188325_9_);
float f2 = (float)(p_188325_18_ - p_188325_11_);
float f3 = MathHelper.sqrt(f * f + f2 * f2);
float f4 = MathHelper.sqrt(f * f + f1 * f1 + f2 * f2);
GlStateManager.pushMatrix();
GlStateManager.translate((float)p_188325_0_, (float)p_188325_2_ + 2.0F, (float)p_188325_4_);
GlStateManager.rotate((float)(-Math.atan2((double)f2, (double)f)) * (180F / (float)Math.PI) - 90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float)(-Math.atan2((double)f3, (double)f1)) * (180F / (float)Math.PI) - 90.0F, 1.0F, 0.0F, 0.0F);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
RenderHelper.disableStandardItemLighting();
GlStateManager.disableCull();
GlStateManager.shadeModel(7425);
float f5 = 0.0F - ((float)p_188325_13_ + p_188325_6_) * 0.01F;
float f6 = MathHelper.sqrt(f * f + f1 * f1 + f2 * f2) / 32.0F - ((float)p_188325_13_ + p_188325_6_) * 0.01F;
vertexbuffer.begin(5, DefaultVertexFormats.POSITION_TEX_COLOR);
int i = 8;
for (int j = 0; j <= 8; ++j)
{
float f7 = MathHelper.sin((float)(j % 8) * ((float)Math.PI * 2F) / 8.0F) * 0.75F;
float f8 = MathHelper.cos((float)(j % 8) * ((float)Math.PI * 2F) / 8.0F) * 0.75F;
float f9 = (float)(j % 8) / 8.0F;
vertexbuffer.pos((double)(f7 * 0.2F), (double)(f8 * 0.2F), 0.0D).tex((double)f9, (double)f5).color(0, 0, 0, 255).endVertex();
vertexbuffer.pos((double)f7, (double)f8, (double)f4).tex((double)f9, (double)f6).color(255, 255, 255, 255).endVertex();
}
tessellator.draw();
GlStateManager.enableCull();
GlStateManager.shadeModel(7424);
RenderHelper.enableStandardItemLighting();
GlStateManager.popMatrix();
}
示例4: renderDebugBoundingBox
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Renders the bounding box around an entity when F3+B is pressed
*/
private void renderDebugBoundingBox(Entity entityIn, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_)
{
GlStateManager.depthMask(false);
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GlStateManager.disableCull();
GlStateManager.disableBlend();
float f = entityIn.width / 2.0F;
AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox();
AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX - entityIn.posX + p_85094_2_, axisalignedbb.minY - entityIn.posY + p_85094_4_, axisalignedbb.minZ - entityIn.posZ + p_85094_6_, axisalignedbb.maxX - entityIn.posX + p_85094_2_, axisalignedbb.maxY - entityIn.posY + p_85094_4_, axisalignedbb.maxZ - entityIn.posZ + p_85094_6_);
RenderGlobal.func_181563_a(axisalignedbb1, 255, 255, 255, 255);
if (entityIn instanceof EntityLivingBase)
{
float f1 = 0.01F;
RenderGlobal.func_181563_a(new AxisAlignedBB(p_85094_2_ - (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() + 0.009999999776482582D, p_85094_6_ + (double)f), 255, 0, 0, 255);
}
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
Vec3 vec3 = entityIn.getLook(p_85094_9_);
worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos(p_85094_2_, p_85094_4_ + (double)entityIn.getEyeHeight(), p_85094_6_).color(0, 0, 255, 255).endVertex();
worldrenderer.pos(p_85094_2_ + vec3.xCoord * 2.0D, p_85094_4_ + (double)entityIn.getEyeHeight() + vec3.yCoord * 2.0D, p_85094_6_ + vec3.zCoord * 2.0D).color(0, 0, 255, 255).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.enableCull();
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
}
示例5: renderItemWithTransform
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void renderItemWithTransform(World world, ItemStack stack,
ItemCameraTransforms.TransformType transform)
{
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.enableCull();
GlStateManager.depthMask(true);
RenderHelper.enableStandardItemLighting();
GlStateManager.enableAlpha();
GlStateManager.enableRescaleNormal();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
GlStateManager.DestFactor.ZERO);
IBakedModel ibakedmodel = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, world,
(EntityLivingBase) null);
IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel,
transform, false);
Minecraft.getMinecraft().getRenderItem().renderItem(stack, transformedModel);
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
RenderHelper.disableStandardItemLighting();
GlStateManager.depthMask(false);
GlStateManager.disableCull();
GlStateManager.popAttrib();
GlStateManager.popMatrix();
}
示例6: doRender
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityEvokerFangs entity, double x, double y, double z, float entityYaw, float partialTicks)
{
float f = entity.func_190550_a(partialTicks);
if (f != 0.0F)
{
float f1 = 2.0F;
if (f > 0.9F)
{
f1 = (float)((double)f1 * ((1.0D - (double)f) / 0.10000000149011612D));
}
GlStateManager.pushMatrix();
GlStateManager.disableCull();
GlStateManager.enableAlpha();
this.bindEntityTexture(entity);
GlStateManager.translate((float)x, (float)y, (float)z);
GlStateManager.rotate(90.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(-f1, -f1, f1);
float f2 = 0.03125F;
GlStateManager.translate(0.0F, -0.626F, 0.0F);
this.field_191330_f.render(entity, f, 0.0F, 0.0F, entity.rotationYaw, entity.rotationPitch, 0.03125F);
GlStateManager.popMatrix();
GlStateManager.enableCull();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}
示例7: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible())
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.enableCull();
GlStateManager.cullFace(1028);
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.2F, 0.35F, 0.5F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(0.1F, 0.0F, -0.6F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F);
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.0F, 0.7F, -0.2F);
GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.cullFace(1029);
GlStateManager.disableCull();
}
}
示例8: renderParticles
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderParticles(EntityPlayer dumbplayer, float partialTicks) {
float f = ActiveRenderInfo.getRotationX();
float f1 = ActiveRenderInfo.getRotationZ();
float f2 = ActiveRenderInfo.getRotationYZ();
float f3 = ActiveRenderInfo.getRotationXY();
float f4 = ActiveRenderInfo.getRotationXZ();
EntityPlayer player = EasyMappings.player();
if (player != null) {
Particle.interpPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
Particle.interpPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
Particle.interpPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
Particle.cameraViewDir = player.getLook(partialTicks);
//GlStateManager.glTexParameterf(3553, 10242, 10497.0F);
//GlStateManager.glTexParameterf(3553, 10243, 10497.0F);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
//GlStateManager.alphaFunc(GL11.GL_GREATER, 0F);
GlStateManager.disableCull();
GlStateManager.depthMask(false);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Tessellator tess = Tessellator.getInstance();
BufferBuilder buffer = tess.getBuffer();
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
for (int i = 0; i < particles.size(); i++) {
particles.get(i).renderParticle(buffer, player, partialTicks, f, f4, f1, f2, f3);
}
tess.draw();
GlStateManager.enableCull();
GlStateManager.depthMask(true);
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.disableBlend();
//GlStateManager.alphaFunc(516, 0.1F);
}
}
示例9: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible())
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.enableCull();
GlStateManager.cullFace(GlStateManager.CullFace.FRONT);
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.2F, 0.35F, 0.5F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(0.1F, 0.0F, -0.6F);
GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
this.mooshroomRenderer.getMainModel().head.postRender(0.0625F);
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.0F, 0.7F, -0.2F);
GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_MUSHROOM.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.cullFace(GlStateManager.CullFace.BACK);
GlStateManager.disableCull();
}
}
示例10: renderTileEntityAt
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderTileEntityAt(TileEntityEnchantmentTable te, double x, double y, double z, float partialTicks, int destroyStage)
{
GlStateManager.pushMatrix();
GlStateManager.translate((float)x + 0.5F, (float)y + 0.75F, (float)z + 0.5F);
float f = (float)te.tickCount + partialTicks;
GlStateManager.translate(0.0F, 0.1F + MathHelper.sin(f * 0.1F) * 0.01F, 0.0F);
float f1;
for (f1 = te.bookRotation - te.bookRotationPrev; f1 >= (float)Math.PI; f1 -= ((float)Math.PI * 2F))
{
;
}
while (f1 < -(float)Math.PI)
{
f1 += ((float)Math.PI * 2F);
}
float f2 = te.bookRotationPrev + f1 * partialTicks;
GlStateManager.rotate(-f2 * 180.0F / (float)Math.PI, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(80.0F, 0.0F, 0.0F, 1.0F);
this.bindTexture(TEXTURE_BOOK);
float f3 = te.pageFlipPrev + (te.pageFlip - te.pageFlipPrev) * partialTicks + 0.25F;
float f4 = te.pageFlipPrev + (te.pageFlip - te.pageFlipPrev) * partialTicks + 0.75F;
f3 = (f3 - (float)MathHelper.truncateDoubleToInt((double)f3)) * 1.6F - 0.3F;
f4 = (f4 - (float)MathHelper.truncateDoubleToInt((double)f4)) * 1.6F - 0.3F;
if (f3 < 0.0F)
{
f3 = 0.0F;
}
if (f4 < 0.0F)
{
f4 = 0.0F;
}
if (f3 > 1.0F)
{
f3 = 1.0F;
}
if (f4 > 1.0F)
{
f4 = 1.0F;
}
float f5 = te.bookSpreadPrev + (te.bookSpread - te.bookSpreadPrev) * partialTicks;
GlStateManager.enableCull();
this.field_147541_c.render((Entity)null, f, f3, f4, f5, 0.0F, 0.0625F);
GlStateManager.popMatrix();
}
示例11: useShader
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void useShader()
{
this.isDirty = false;
staticShaderManager = this;
this.blendingMode.apply();
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();
}
}
示例12: onRenderWorld
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onRenderWorld(RenderWorldLastEvent event) {
if(renderers != null) try {
GlStateManager.pushMatrix();
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.shadeModel(GL11.GL_SMOOTH);
if(!clear_buffer.get())
GlStateManager.disableDepth();
else {
GlStateManager.clearDepth(1.f);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
}
final boolean aa_enabled = anti_aliasing.get();
final int aa_max = anti_aliasing_max.get();
GlStateManager.glEnableClientState(GL11.GL_VERTEX_ARRAY);
GlStateManager.glEnableClientState(GL11.GL_COLOR_ARRAY);
renderers.forEach((chk, info) -> {
if (info.isVboPresent() && info.isRendering()) {
if(aa_enabled && (aa_max == 0 || info.getRenderCount() <= aa_max))
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GlStateManager.pushMatrix();
BlockPos pos = chk.getPosition();
GlStateManager.translate(
(double) pos.getX() - renderingOffset.x,
(double) pos.getY() - renderingOffset.y,
(double) pos.getZ() - renderingOffset.z
);
chk.multModelviewMatrix();
info.getVbo().bindBuffer();
GlStateManager.glVertexPointer(
DefaultVertexFormats.POSITION_3F.getElementCount(),
DefaultVertexFormats.POSITION_3F.getType().getGlConstant(),
DefaultVertexFormats.POSITION_3F.getSize() + DefaultVertexFormats.COLOR_4UB.getSize(),
0
);
GlStateManager.glColorPointer(
DefaultVertexFormats.COLOR_4UB.getElementCount(),
DefaultVertexFormats.COLOR_4UB.getType().getGlConstant(),
DefaultVertexFormats.POSITION_3F.getSize() + DefaultVertexFormats.COLOR_4UB.getSize(),
DefaultVertexFormats.POSITION_3F.getSize()
);
info.getVbo().drawArrays(GL11.GL_LINES);
GlStateManager.popMatrix();
GL11.glDisable(GL11.GL_LINE_SMOOTH);
info.setRendering(false);
}
});
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GlStateManager.glDisableClientState(GL11.GL_VERTEX_ARRAY);
GlStateManager.glDisableClientState(GL11.GL_COLOR_ARRAY);
OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0);
GlStateManager.shadeModel(GL11.GL_FLAT);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
GlStateManager.enableCull();
GlStateManager.popMatrix();
} catch (Exception e) {
handleException(null, e);
}
}
示例13: renderParticles
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderParticles(EntityPlayer dumbplayer, float partialTicks) {
float f = ActiveRenderInfo.getRotationX();
float f1 = ActiveRenderInfo.getRotationZ();
float f2 = ActiveRenderInfo.getRotationYZ();
float f3 = ActiveRenderInfo.getRotationXY();
float f4 = ActiveRenderInfo.getRotationXZ();
EntityPlayer player = Minecraft.getMinecraft().player;
if (player != null){
Particle.interpPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
Particle.interpPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
Particle.interpPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
Particle.cameraViewDir = player.getLook(partialTicks);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.alphaFunc(516, 0.003921569F);
GlStateManager.disableCull();
GlStateManager.depthMask(false);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Tessellator tess = Tessellator.getInstance();
VertexBuffer buffer = tess.getBuffer();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
for (int i = 0; i < particles.size(); i ++){
if (particles.get(i) instanceof IParticle){
if (!((IParticle)particles.get(i)).isAdditive()){
particles.get(i).renderParticle(buffer, player, partialTicks, f, f4, f1, f2, f3);
}
}
}
tess.draw();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
for (int i = 0; i < particles.size(); i ++){
if (particles.get(i) != null){
if (((IParticle)particles.get(i)).isAdditive()){
particles.get(i).renderParticle(buffer, player, partialTicks, f, f4, f1, f2, f3);
}
}
}
tess.draw();
GlStateManager.disableDepth();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
for (int i = 0; i < particles.size(); i ++){
if (particles.get(i) instanceof IParticle){
if (!((IParticle)particles.get(i)).isAdditive() && ((IParticle)particles.get(i)).renderThroughBlocks()){
particles.get(i).renderParticle(buffer, player, partialTicks, f, f4, f1, f2, f3);
}
}
}
tess.draw();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
for (int i = 0; i < particles.size(); i ++){
if (particles.get(i) != null){
if (((IParticle)particles.get(i)).isAdditive() && ((IParticle)particles.get(i)).renderThroughBlocks()){
particles.get(i).renderParticle(buffer, player, partialTicks, f, f4, f1, f2, f3);
}
}
}
tess.draw();
GlStateManager.enableDepth();
GlStateManager.enableCull();
GlStateManager.depthMask(true);
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.disableBlend();
GlStateManager.alphaFunc(516, 0.1F);
}
}
示例14: renderByItem
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderByItem(ItemStack itemStackIn)
{
if (itemStackIn.getItem() == Items.BANNER)
{
this.banner.setItemValues(itemStackIn);
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.banner, 0.0D, 0.0D, 0.0D, 0.0F);
}
else if (itemStackIn.getItem() == Items.SHIELD)
{
if (itemStackIn.getSubCompound("BlockEntityTag", false) != null)
{
this.banner.setItemValues(itemStackIn);
Minecraft.getMinecraft().getTextureManager().bindTexture(BannerTextures.SHIELD_DESIGNS.getResourceLocation(this.banner.getPatternResourceLocation(), this.banner.getPatternList(), this.banner.getColorList()));
}
else
{
Minecraft.getMinecraft().getTextureManager().bindTexture(BannerTextures.SHIELD_BASE_TEXTURE);
}
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, -1.0F);
this.modelShield.render();
GlStateManager.popMatrix();
}
else if (itemStackIn.getItem() == Items.SKULL)
{
GameProfile gameprofile = null;
if (itemStackIn.hasTagCompound())
{
NBTTagCompound nbttagcompound = itemStackIn.getTagCompound();
if (nbttagcompound.hasKey("SkullOwner", 10))
{
gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
}
else if (nbttagcompound.hasKey("SkullOwner", 8) && !nbttagcompound.getString("SkullOwner").isEmpty())
{
GameProfile lvt_2_2_ = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner"));
gameprofile = TileEntitySkull.updateGameprofile(lvt_2_2_);
nbttagcompound.removeTag("SkullOwner");
nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
}
}
if (TileEntitySkullRenderer.instance != null)
{
GlStateManager.pushMatrix();
GlStateManager.disableCull();
TileEntitySkullRenderer.instance.renderSkull(0.0F, 0.0F, 0.0F, EnumFacing.UP, 0.0F, itemStackIn.getMetadata(), gameprofile, -1, 0.0F);
GlStateManager.enableCull();
GlStateManager.popMatrix();
}
}
else
{
Block block = Block.getBlockFromItem(itemStackIn.getItem());
if (block == Blocks.ENDER_CHEST)
{
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.enderChest, 0.0D, 0.0D, 0.0D, 0.0F);
}
else if (block == Blocks.TRAPPED_CHEST)
{
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chestTrap, 0.0D, 0.0D, 0.0D, 0.0F);
}
else if (block != Blocks.CHEST) net.minecraftforge.client.ForgeHooksClient.renderTileItem(itemStackIn.getItem(), itemStackIn.getMetadata());
else
{
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chestBasic, 0.0D, 0.0D, 0.0D, 0.0F);
}
}
}
示例15: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.deathTicks > 0)
{
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
RenderHelper.disableStandardItemLighting();
float f = ((float)entitylivingbaseIn.deathTicks + partialTicks) / 200.0F;
float f1 = 0.0F;
if (f > 0.8F)
{
f1 = (f - 0.8F) / 0.2F;
}
Random random = new Random(432L);
GlStateManager.disableTexture2D();
GlStateManager.shadeModel(7425);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
GlStateManager.disableAlpha();
GlStateManager.enableCull();
GlStateManager.depthMask(false);
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, -1.0F, -2.0F);
for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i)
{
GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F);
float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F;
float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F;
vertexbuffer.begin(6, DefaultVertexFormats.POSITION_COLOR);
vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex();
vertexbuffer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
vertexbuffer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
vertexbuffer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex();
vertexbuffer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
tessellator.draw();
}
GlStateManager.popMatrix();
GlStateManager.depthMask(true);
GlStateManager.disableCull();
GlStateManager.disableBlend();
GlStateManager.shadeModel(7424);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableTexture2D();
GlStateManager.enableAlpha();
RenderHelper.enableStandardItemLighting();
}
}