Posted April 27, 20205 yr First of all, please forgive me for my poor English. I want to render triangle above entity. Requirement: 1:I want the name of the entity to be transparent. 2:But ,I don't want the entity's shadow to be transparent. This is my cord and screenshot. Spoiler public class TestModel extends EntityModel<TestEntity> { /* some codes */ @Override public void render(TestEntity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { this.setRotationAngles(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); this.head.render(scale); this.body.render(scale); GlStateManager.depthMask(false); GlStateManager.disableTexture(); GlStateManager.enableAlphaTest(); GlStateManager.disableLighting(); GlStateManager.disableCull(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR); bufferbuilder.pos(0,-2,0).color(0, 0, 255, 255).endVertex(); bufferbuilder.pos(0,-2,1).color(0, 0, 255, 255).endVertex(); bufferbuilder.pos(1,-2,1).color(0, 0, 255, 255).endVertex(); tessellator.draw(); GlStateManager.enableTexture(); GlStateManager.enableLighting(); GlStateManager.enableCull(); GlStateManager.disableBlend(); GlStateManager.disableAlphaTest(); GlStateManager.depthMask(true); } /* some codes */ }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.