Example usage for org.lwjgl.opengl GL11 glDepthMask

List of usage examples for org.lwjgl.opengl GL11 glDepthMask

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glDepthMask.

Prototype

public static void glDepthMask(@NativeType("GLboolean") boolean flag) 

Source Link

Document

Masks the writing of depth values to the depth buffer.

Usage

From source file:kuake2.render.lwjgl.Main.java

License:Open Source License

/**
 * GL_DrawParticles/*from  w w w .  j av  a2  s .  c  o  m*/
 */
void GL_DrawParticles(int num_particles) {
    float origin_x, origin_y, origin_z;

    Math3D.VectorScale(vup, 1.5f, up);
    Math3D.VectorScale(vright, 1.5f, right);

    GL_Bind(r_particletexture.texnum);
    GL11.glDepthMask(false); // no z buffering
    GL11.glEnable(GL11.GL_BLEND);
    GL_TexEnv(GL11.GL_MODULATE);

    GL11.glBegin(GL11.GL_TRIANGLES);

    FloatBuffer sourceVertices = particle_t.vertexArray;
    IntBuffer sourceColors = particle_t.colorArray;
    float scale;
    int color;
    for (int j = 0, i = 0; i < num_particles; i++) {
        origin_x = sourceVertices.get(j++);
        origin_y = sourceVertices.get(j++);
        origin_z = sourceVertices.get(j++);

        // hack a scale up to keep particles from disapearing
        scale = (origin_x - r_origin[0]) * vpn[0] + (origin_y - r_origin[1]) * vpn[1]
                + (origin_z - r_origin[2]) * vpn[2];

        scale = (scale < 20) ? 1 : 1 + scale * 0.004f;

        color = sourceColors.get(i);

        GL11.glColor4ub((byte) ((color) & 0xFF), (byte) ((color >> 8) & 0xFF), (byte) ((color >> 16) & 0xFF),
                (byte) ((color >>> 24)));
        // first vertex
        GL11.glTexCoord2f(0.0625f, 0.0625f);
        GL11.glVertex3f(origin_x, origin_y, origin_z);
        // second vertex
        GL11.glTexCoord2f(1.0625f, 0.0625f);
        GL11.glVertex3f(origin_x + up[0] * scale, origin_y + up[1] * scale, origin_z + up[2] * scale);
        // third vertex
        GL11.glTexCoord2f(0.0625f, 1.0625f);
        GL11.glVertex3f(origin_x + right[0] * scale, origin_y + right[1] * scale, origin_z + right[2] * scale);
    }
    GL11.glEnd();

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glColor4f(1, 1, 1, 1);
    GL11.glDepthMask(true); // back to normal Z buffering
    GL_TexEnv(GL11.GL_REPLACE);
}

From source file:kuake2.render.lwjgl.Main.java

License:Open Source License

/**
 * R_DrawParticles//  w ww .  j a  v a2 s.  co m
 */
void R_DrawParticles() {

    if (gl_ext_pointparameters.value != 0.0f && qglPointParameterfEXT) {

        //GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
        GL11.glVertexPointer(3, 0, particle_t.vertexArray);
        GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
        GL11.glColorPointer(4, true, 0, particle_t.getColorAsByteBuffer());

        GL11.glDepthMask(false);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glPointSize(gl_particle_size.value);

        GL11.glDrawArrays(GL11.GL_POINTS, 0, r_newrefdef.num_particles);

        GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
        //GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);

        GL11.glDisable(GL11.GL_BLEND);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDepthMask(true);
        GL11.glEnable(GL11.GL_TEXTURE_2D);

    } else {
        GL_DrawParticles(r_newrefdef.num_particles);
    }
}

From source file:kuake2.render.lwjgl.Main.java

License:Open Source License

/**
 * R_DrawBeam/*from   www.  j  ava 2s . c o m*/
 */
void R_DrawBeam(entity_t e) {
    oldorigin[0] = e.oldorigin[0];
    oldorigin[1] = e.oldorigin[1];
    oldorigin[2] = e.oldorigin[2];

    origin[0] = e.origin[0];
    origin[1] = e.origin[1];
    origin[2] = e.origin[2];

    normalized_direction[0] = direction[0] = oldorigin[0] - origin[0];
    normalized_direction[1] = direction[1] = oldorigin[1] - origin[1];
    normalized_direction[2] = direction[2] = oldorigin[2] - origin[2];

    if (Math3D.VectorNormalize(normalized_direction) == 0.0f)
        return;

    Math3D.PerpendicularVector(perpvec, normalized_direction);
    Math3D.VectorScale(perpvec, e.frame / 2, perpvec);

    for (int i = 0; i < 6; i++) {
        Math3D.RotatePointAroundVector(start_points[i], normalized_direction, perpvec,
                (360.0f / NUM_BEAM_SEGS) * i);

        Math3D.VectorAdd(start_points[i], origin, start_points[i]);
        Math3D.VectorAdd(start_points[i], direction, end_points[i]);
    }

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDepthMask(false);

    float r = (d_8to24table[e.skinnum & 0xFF]) & 0xFF;
    float g = (d_8to24table[e.skinnum & 0xFF] >> 8) & 0xFF;
    float b = (d_8to24table[e.skinnum & 0xFF] >> 16) & 0xFF;

    r *= 1 / 255.0f;
    g *= 1 / 255.0f;
    b *= 1 / 255.0f;

    GL11.glColor4f(r, g, b, e.alpha);

    GL11.glBegin(GL11.GL_TRIANGLE_STRIP);

    float[] v;

    for (int i = 0; i < NUM_BEAM_SEGS; i++) {
        v = start_points[i];
        GL11.glVertex3f(v[0], v[1], v[2]);
        v = end_points[i];
        GL11.glVertex3f(v[0], v[1], v[2]);
        v = start_points[(i + 1) % NUM_BEAM_SEGS];
        GL11.glVertex3f(v[0], v[1], v[2]);
        v = end_points[(i + 1) % NUM_BEAM_SEGS];
        GL11.glVertex3f(v[0], v[1], v[2]);
    }
    GL11.glEnd();

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
}

From source file:lyonlancer5.pfsteel.client.render.entity.RenderDesertCreeper.java

License:Open Source License

/**
 * Queries whether should render the specified pass or not.
 *///from   www. j a  v  a 2s  .c  om
protected int shouldRenderPass(EntityDesertCreeper p_77032_1_, int p_77032_2_, float p_77032_3_) {
    if (p_77032_1_.getPowered()) {
        if (p_77032_1_.isInvisible()) {
            GL11.glDepthMask(false);
        } else {
            GL11.glDepthMask(true);
        }

        if (p_77032_2_ == 1) {
            float f1 = (float) p_77032_1_.ticksExisted + p_77032_3_;
            this.bindTexture(armoredCreeperTextures);
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            float f2 = f1 * 0.01F;
            float f3 = f1 * 0.01F;
            GL11.glTranslatef(f2, f3, 0.0F);
            this.setRenderPassModel(this.creeperModel);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_BLEND);
            float f4 = 0.5F;
            GL11.glColor4f(f4, f4, f4, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            return 1;
        }

        if (p_77032_2_ == 2) {
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_BLEND);
        }
    }

    return -1;
}

From source file:lyonlancer5.pfsteel.client.render.entity.RenderNetherCreeper.java

License:Open Source License

/**
 * Queries whether should render the specified pass or not.
 *///from   w w  w .  j a  va  2s. co  m
protected int shouldRenderPass(EntityNetherCreeper p_77032_1_, int p_77032_2_, float p_77032_3_) {
    if (p_77032_1_.getPowered()) {
        if (p_77032_1_.isInvisible()) {
            GL11.glDepthMask(false);
        } else {
            GL11.glDepthMask(true);
        }

        if (p_77032_2_ == 1) {
            float f1 = (float) p_77032_1_.ticksExisted + p_77032_3_;
            this.bindTexture(armoredCreeperTextures);
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            float f2 = f1 * 0.01F;
            float f3 = f1 * 0.01F;
            GL11.glTranslatef(f2, f3, 0.0F);
            this.setRenderPassModel(this.creeperModel);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_BLEND);
            float f4 = 0.5F;
            GL11.glColor4f(f4, f4, f4, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            return 1;
        }

        if (p_77032_2_ == 2) {
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_BLEND);
        }
    }

    return -1;
}

From source file:lyonlancer5.pfsteel.client.render.entity.RenderSnowCreeper.java

License:Open Source License

/**
 * Queries whether should render the specified pass or not.
 *///from  w w w. j a va2s  . c  o m
protected int shouldRenderPass(EntitySnowCreeper p_77032_1_, int p_77032_2_, float p_77032_3_) {
    if (p_77032_1_.getPowered()) {
        if (p_77032_1_.isInvisible()) {
            GL11.glDepthMask(false);
        } else {
            GL11.glDepthMask(true);
        }

        if (p_77032_2_ == 1) {
            float f1 = (float) p_77032_1_.ticksExisted + p_77032_3_;
            this.bindTexture(armoredCreeperTextures);
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            float f2 = f1 * 0.01F;
            float f3 = f1 * 0.01F;
            GL11.glTranslatef(f2, f3, 0.0F);
            this.setRenderPassModel(this.creeperModel);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_BLEND);
            float f4 = 0.5F;
            GL11.glColor4f(f4, f4, f4, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            return 1;
        }

        if (p_77032_2_ == 2) {
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_BLEND);
        }
    }

    return -1;
}

From source file:lyonlancer5.pfsteel.client.render.RenderDarkShield.java

License:Open Source License

protected void renderDarkMain(EntityDarkShield shield, double x, double y, double z, float yaw, float pitch) {
    GL11.glDisable(GL11.GL_LIGHTING);/*w  w w. j  av a 2s . com*/

    GL11.glPushMatrix();
    GL11.glDisable(GL11.GL_CULL_FACE);
    if (RenderManager.instance.getDistanceToCamera(shield.posX, shield.posY, shield.posZ) < 36.0D) {
        GL11.glDepthFunc(GL11.GL_ALWAYS);
    } else {
        GL11.glDepthMask(false);
    }
    GL11.glTranslatef((float) x, (float) y, (float) z);
    GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F);

    Tessellator tessellator = Tessellator.instance;
    GL11.glDepthMask(false);
    GL11.glEnable(GL11.GL_BLEND);

    GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR);
    GL11.glTranslatef(0.0F, 1.3F, 0.0F);
    this.bindTexture(darkTex);
    renderDark(tessellator, 12.0D, 12.0F, 0.0D, 1.0F, 0);
    GL11.glDisable(GL11.GL_BLEND);

    GL11.glDepthFunc(GL11.GL_LEQUAL);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glDepthMask(true);
    GL11.glPopMatrix();

    GL11.glEnable(GL11.GL_LIGHTING);
}

From source file:lyonlancer5.pfsteel.world.dimension.yakusoku.YakusokuSkyRenderer.java

License:Open Source License

@Override
@SideOnly(Side.CLIENT)/*from w  w w.  j a v a 2  s  . c  o  m*/
public void render(float partialTicks, WorldClient world, Minecraft mc) {
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks);
    float f1 = (float) vec3.xCoord;
    float f2 = (float) vec3.yCoord;
    float f3 = (float) vec3.zCoord;
    float f4;
    if (mc.gameSettings.anaglyph) {
        float f5 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f6 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        f4 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f5;
        f2 = f6;
        f3 = f4;
    }
    GL11.glColor3f(f1, f2, f3);
    Tessellator tessellator1 = Tessellator.instance;
    GL11.glDepthMask(false);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glColor3f(f1, f2, f3);
    GL11.glCallList(this.glSkyList);
    GL11.glDisable(GL11.GL_FOG);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderHelper.disableStandardItemLighting();
    float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks),
            partialTicks);
    float f7;
    float f8;
    float f9;
    float f10;
    if (afloat != null) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glShadeModel(GL11.GL_SMOOTH);
        GL11.glPushMatrix();
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F,
                0.0F, 0.0F, 1.0F);
        GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
        f4 = afloat[0];
        f7 = afloat[1];
        f8 = afloat[2];
        float f11;
        if (mc.gameSettings.anaglyph) {
            f9 = (f4 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F;
            f10 = (f4 * 30.0F + f7 * 70.0F) / 100.0F;
            f11 = (f4 * 30.0F + f8 * 70.0F) / 100.0F;
            f4 = f9;
            f7 = f10;
            f8 = f11;
        }
        tessellator1.startDrawing(6);
        tessellator1.setColorRGBA_F(f4, f7, f8, afloat[3]);
        tessellator1.addVertex(0.0D, 100.0D, 0.0D);
        byte b0 = 16;
        tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F);
        for (int j = 0; j <= b0; ++j) {
            f11 = (float) j * (float) Math.PI * 2.0F / (float) b0;
            float f12 = MathHelper.sin(f11);
            float f13 = MathHelper.cos(f11);
            tessellator1.addVertex((double) (f12 * 120.0F), (double) (f13 * 120.0F),
                    (double) (-f13 * 40.0F * afloat[3]));
        }
        tessellator1.draw();
        GL11.glPopMatrix();
        GL11.glShadeModel(GL11.GL_FLAT);
    }
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
    GL11.glPushMatrix();
    f4 = 1.0F - world.getRainStrength(partialTicks);
    f7 = 0.0F;
    f8 = 0.0F;
    f9 = 0.0F;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, f4);
    GL11.glTranslatef(f7, f8, f9);
    GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);

    f10 = 20.0F; // Size of sun from center
    mc.renderEngine
            .bindTexture(new ResourceLocation(ModVersion.modid, "textures/environment/yakusoku_sun.png"));

    tessellator1.startDrawingQuads();
    tessellator1.addVertexWithUV((double) (-f10), 100.0D, (double) (-f10), 0.0D, 0.0D);
    tessellator1.addVertexWithUV((double) f10, 100.0D, (double) (-f10), 1.0D, 0.0D);
    tessellator1.addVertexWithUV((double) f10, 100.0D, (double) f10, 1.0D, 1.0D);
    tessellator1.addVertexWithUV((double) (-f10), 100.0D, (double) f10, 0.0D, 1.0D);

    tessellator1.draw(); // Draw sun
    f10 = 15.0F; // Size of moon from center

    mc.renderEngine.bindTexture(
            new ResourceLocation(ModVersion.modid, "textures/environment/yakusoku_moon_phases.png"));

    int k = world.getMoonPhase();
    int l = k % 4;
    int i1 = k / 4 % 2;
    float f14 = (float) (l + 0) / 4.0F;
    float f15 = (float) (i1 + 0) / 2.0F;
    float f16 = (float) (l + 1) / 4.0F;
    float f17 = (float) (i1 + 1) / 2.0F;
    tessellator1.startDrawingQuads();
    tessellator1.addVertexWithUV((double) (-f10), -100.0D, (double) f10, (double) f16, (double) f17);
    tessellator1.addVertexWithUV((double) f10, -100.0D, (double) f10, (double) f14, (double) f17);
    tessellator1.addVertexWithUV((double) f10, -100.0D, (double) (-f10), (double) f14, (double) f15);
    tessellator1.addVertexWithUV((double) (-f10), -100.0D, (double) (-f10), (double) f16, (double) f15);
    tessellator1.draw();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    float f18 = world.getStarBrightness(partialTicks) * f4;
    if (f18 > 0.0F) {
        GL11.glColor4f(f18, f18, f18, f18);
        GL11.glCallList(this.starGLCallList);
    }
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_FOG);
    GL11.glPopMatrix();
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glColor3f(0.0F, 0.0F, 0.0F);
    double d0 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon();
    if (d0 < 0.0D) {
        GL11.glPushMatrix();
        GL11.glTranslatef(0.0F, 12.0F, 0.0F);
        GL11.glCallList(this.glSkyList2);
        GL11.glPopMatrix();
        f8 = 1.0F;
        f9 = -((float) (d0 + 65.0D));
        f10 = -f8;
        tessellator1.startDrawingQuads();
        tessellator1.setColorRGBA_I(0, 255);
        tessellator1.addVertex((double) (-f8), (double) f9, (double) f8);
        tessellator1.addVertex((double) f8, (double) f9, (double) f8);
        tessellator1.addVertex((double) f8, (double) f10, (double) f8);
        tessellator1.addVertex((double) (-f8), (double) f10, (double) f8);
        tessellator1.addVertex((double) (-f8), (double) f10, (double) (-f8));
        tessellator1.addVertex((double) f8, (double) f10, (double) (-f8));
        tessellator1.addVertex((double) f8, (double) f9, (double) (-f8));
        tessellator1.addVertex((double) (-f8), (double) f9, (double) (-f8));
        tessellator1.addVertex((double) f8, (double) f10, (double) (-f8));
        tessellator1.addVertex((double) f8, (double) f10, (double) f8);
        tessellator1.addVertex((double) f8, (double) f9, (double) f8);
        tessellator1.addVertex((double) f8, (double) f9, (double) (-f8));
        tessellator1.addVertex((double) (-f8), (double) f9, (double) (-f8));
        tessellator1.addVertex((double) (-f8), (double) f9, (double) f8);
        tessellator1.addVertex((double) (-f8), (double) f10, (double) f8);
        tessellator1.addVertex((double) (-f8), (double) f10, (double) (-f8));
        tessellator1.addVertex((double) (-f8), (double) f10, (double) (-f8));
        tessellator1.addVertex((double) (-f8), (double) f10, (double) f8);
        tessellator1.addVertex((double) f8, (double) f10, (double) f8);
        tessellator1.addVertex((double) f8, (double) f10, (double) (-f8));
        tessellator1.draw();
    }
    if (world.provider.isSkyColored()) {
        GL11.glColor3f(0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F);
        //GL11.glColor3f(0.2F + 0.04F, f2 * 0.6F + 0.1F, f3 * 0.2F + 0.04F);
    } else {
        GL11.glColor3f(f1, f2, f3);
    }
    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, -((float) (d0 - 16.0D)), 0.0F);
    GL11.glCallList(this.glSkyList2);
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(true);
}

From source file:map.GameMap.java

License:Open Source License

public void drawWater() {
    GL11.glEnable(GL11.GL_BLEND);//from w w w  .ja v  a 2 s  .c om
    GL11.glDepthMask(false);
    waterMaterial.bind();
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glNormal3f(0, 0, 1.0f);
    GL11.glTexCoord2f(0, 0);
    GL11.glVertex3f(0, 0, WATER_HEIGHT);
    GL11.glTexCoord2f(size, 0);
    GL11.glVertex3f(size, 0, WATER_HEIGHT);
    GL11.glTexCoord2f(size, size);
    GL11.glVertex3f(size, size, WATER_HEIGHT);
    GL11.glTexCoord2f(0, size);
    GL11.glVertex3f(0, size, WATER_HEIGHT);
    GL11.glEnd();
    GL11.glDepthMask(true);
    GL11.glDisable(GL11.GL_BLEND);
}

From source file:matteroverdrive.client.render.entity.EntityRendererRougeAndroid.java

License:Open Source License

@Override
public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
        float p_76986_8_, float p_76986_9_) {
    if (hologram) {
        GL11.glPushMatrix();//w w  w. j  av a2 s .  c o m
        GL11.glDisable(GL11.GL_CULL_FACE);
        this.mainModel.onGround = this.renderSwingProgress(p_76986_1_, p_76986_9_);

        if (this.renderPassModel != null) {
            this.renderPassModel.onGround = this.mainModel.onGround;
        }

        this.mainModel.isRiding = p_76986_1_.isRiding();

        if (this.renderPassModel != null) {
            this.renderPassModel.isRiding = this.mainModel.isRiding;
        }

        this.mainModel.isChild = p_76986_1_.isChild();

        if (this.renderPassModel != null) {
            this.renderPassModel.isChild = this.mainModel.isChild;
        }

        this.renderLivingAt(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_);

        try {
            float f2 = 0;
            float f3 = 0;
            float f4;

            f4 = this.handleRotationFloat(p_76986_1_, p_76986_9_);
            this.rotateCorpse(p_76986_1_, f4, f2, p_76986_9_);
            float f5 = 0.0625F;
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
            GL11.glScalef(-1.0F, -1.0F, 1.0F);
            this.preRenderCallback(p_76986_1_, p_76986_9_);
            GL11.glTranslatef(0.0F, -24.0F * f5 - 0.0078125F, 0.0F);
            float f6 = p_76986_1_.prevLimbSwingAmount
                    + (p_76986_1_.limbSwingAmount - p_76986_1_.prevLimbSwingAmount) * p_76986_9_;
            float f7 = p_76986_1_.limbSwing - p_76986_1_.limbSwingAmount * (1.0F - p_76986_9_);

            if (p_76986_1_.isChild()) {
                f7 *= 3.0F;
            }

            if (f6 > 1.0F) {
                f6 = 1.0F;
            }

            GL11.glEnable(GL11.GL_ALPHA_TEST);
            this.mainModel.setLivingAnimations(p_76986_1_, f7, f6, p_76986_9_);
            this.renderModel(p_76986_1_, f7, f6, f4, f3 - f2, p_76986_1_.rotationPitch, f5);
            int j;
            float f8;
            float f9;
            float f10;

            for (int i = 0; i < 4; ++i) {
                j = this.shouldRenderPass(p_76986_1_, i, p_76986_9_);

                if (j > 0) {
                    this.renderPassModel.setLivingAnimations(p_76986_1_, f7, f6, p_76986_9_);
                    this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, p_76986_1_.rotationPitch, f5);

                    if ((j & 240) == 16) {
                        this.func_82408_c(p_76986_1_, i, p_76986_9_);
                        this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, p_76986_1_.rotationPitch,
                                f5);
                    }

                    if ((j & 15) == 15) {
                        f8 = (float) p_76986_1_.ticksExisted + p_76986_9_;
                        //this.bindTexture(RES_ITEM_GLINT);
                        GL11.glEnable(GL11.GL_BLEND);
                        f9 = 0.5F;
                        GL11.glColor4f(f9, f9, f9, 1.0F);
                        GL11.glDepthFunc(GL11.GL_EQUAL);
                        GL11.glDepthMask(false);

                        for (int k = 0; k < 2; ++k) {
                            GL11.glDisable(GL11.GL_LIGHTING);
                            f10 = 0.76F;
                            GL11.glColor4f(0.5F * f10, 0.25F * f10, 0.8F * f10, 1.0F);
                            GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
                            GL11.glMatrixMode(GL11.GL_TEXTURE);
                            GL11.glLoadIdentity();
                            float f11 = f8 * (0.001F + (float) k * 0.003F) * 20.0F;
                            float f12 = 0.33333334F;
                            GL11.glScalef(f12, f12, f12);
                            GL11.glRotatef(30.0F - (float) k * 60.0F, 0.0F, 0.0F, 1.0F);
                            GL11.glTranslatef(0.0F, f11, 0.0F);
                            GL11.glMatrixMode(GL11.GL_MODELVIEW);
                            this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2,
                                    p_76986_1_.rotationPitch, f5);
                        }

                        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                        GL11.glMatrixMode(GL11.GL_TEXTURE);
                        GL11.glDepthMask(true);
                        GL11.glLoadIdentity();
                        GL11.glMatrixMode(GL11.GL_MODELVIEW);
                        GL11.glEnable(GL11.GL_LIGHTING);
                        GL11.glDisable(GL11.GL_BLEND);
                        GL11.glDepthFunc(GL11.GL_LEQUAL);
                    }

                    GL11.glDisable(GL11.GL_BLEND);
                    GL11.glEnable(GL11.GL_ALPHA_TEST);
                }
            }

            GL11.glDepthMask(true);
            this.renderEquippedItems(p_76986_1_, p_76986_9_);
            float f14 = p_76986_1_.getBrightness(p_76986_9_);
            j = this.getColorMultiplier(p_76986_1_, f14, p_76986_9_);
            OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
            GL11.glDisable(GL11.GL_TEXTURE_2D);
            OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);

            if ((j >> 24 & 255) > 0 || p_76986_1_.hurtTime > 0 || p_76986_1_.deathTime > 0) {
                GL11.glDisable(GL11.GL_TEXTURE_2D);
                GL11.glDisable(GL11.GL_ALPHA_TEST);
                GL11.glEnable(GL11.GL_BLEND);
                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
                GL11.glDepthFunc(GL11.GL_EQUAL);

                if (p_76986_1_.hurtTime > 0 || p_76986_1_.deathTime > 0) {
                    GL11.glColor4f(f14, 0.0F, 0.0F, 0.4F);
                    this.mainModel.render(p_76986_1_, f7, f6, f4, f3 - f2, p_76986_1_.rotationPitch, f5);

                    for (int l = 0; l < 4; ++l) {
                        if (this.inheritRenderPass(p_76986_1_, l, p_76986_9_) >= 0) {
                            GL11.glColor4f(f14, 0.0F, 0.0F, 0.4F);
                            this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2,
                                    p_76986_1_.rotationPitch, f5);
                        }
                    }
                }

                if ((j >> 24 & 255) > 0) {
                    f8 = (float) (j >> 16 & 255) / 255.0F;
                    f9 = (float) (j >> 8 & 255) / 255.0F;
                    float f15 = (float) (j & 255) / 255.0F;
                    f10 = (float) (j >> 24 & 255) / 255.0F;
                    GL11.glColor4f(f8, f9, f15, f10);
                    this.mainModel.render(p_76986_1_, f7, f6, f4, f3 - f2, p_76986_1_.rotationPitch, f5);

                    for (int i1 = 0; i1 < 4; ++i1) {
                        if (this.inheritRenderPass(p_76986_1_, i1, p_76986_9_) >= 0) {
                            GL11.glColor4f(f8, f9, f15, f10);
                            this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2,
                                    p_76986_1_.rotationPitch, f5);
                        }
                    }
                }

                GL11.glDepthFunc(GL11.GL_LEQUAL);
                GL11.glDisable(GL11.GL_BLEND);
                GL11.glEnable(GL11.GL_ALPHA_TEST);
                GL11.glEnable(GL11.GL_TEXTURE_2D);
            }

            GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        } catch (Exception exception) {

        }

        OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glPopMatrix();
        this.passSpecialRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_);
    } else {
        super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
    }
}