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:fr.ign.cogit.geoxygene.appli.render.DisplayableTextRenderer.java

License:Open Source License

private void drawText() throws GLException {
    if (this.program == null || this.textImage == null) {
        Logger.getRootLogger().debug("The GeoxGLTextRenderer " + this.hashCode() + "is not ready yet");
        return;/*from  w w w .  ja  v  a  2s  .c o  m*/
    }
    this.textImage.getRGB(0, 0, width, height, this.pixels, 0, width);
    this.buffer.rewind();
    for (int y = height - 1; y >= 0; y--) {
        for (int x = 0; x < width; x++) {
            int pixel = this.pixels[y * width + x];
            this.buffer.put((byte) (pixel >> 16 & 0xFF)); // Red component
            this.buffer.put((byte) (pixel >> 8 & 0xFF)); // Green component
            this.buffer.put((byte) (pixel >> 0 & 0xFF)); // Blue component
            this.buffer.put((byte) (pixel >> 24 & 0xFF)); // Alpha component
        }
    }
    this.buffer.rewind();
    glEnable(GL_TEXTURE_2D);
    GL13.glActiveTexture(GL13.GL_TEXTURE0 + 2);
    glBindTexture(GL_TEXTURE_2D, this.getTextTextureId());

    // Setup texture scaling filtering
    GL11.glTexParameteri(GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
    GL11.glTexParameteri(GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
    GL11.glTexImage2D(GL_TEXTURE_2D, 0, GL11.GL_RGBA8, width, height, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE,
            this.buffer);

    Integer fbow = (Integer) GLContext.getActiveGlContext()
            .getSharedUniform(GeoxygeneConstants.GL_VarName_FboWidth);
    Integer fboh = (Integer) GLContext.getActiveGlContext()
            .getSharedUniform(GeoxygeneConstants.GL_VarName_FboHeight);
    GL11.glViewport(0, 0, fbow, fboh);
    glDisable(GL11.GL_POLYGON_SMOOTH);
    GLContext.getActiveGlContext().setCurrentProgram(program);
    program.setUniform1i("colorTexture2", 2);
    GLTools.glCheckError("texture binding");

    GL11.glDepthMask(false);
    glDisable(GL11.GL_DEPTH_TEST);

    GL30.glBindVertexArray(LayerViewGLPanel.getScreenQuad().getVaoId());
    GLTools.glCheckError("before drawing textured quad VAO binding");

    program.setUniform(GeoxygeneConstants.GL_VarName_ObjectOpacityVarName, 1f);
    program.setUniform(GeoxygeneConstants.GL_VarName_GlobalOpacityVarName, 1f);
    glEnable(GL_BLEND);
    GL11.glBlendFunc(GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
    GLTools.glCheckError("blending set for textured quad");

    LwjglLayerRenderer.drawComplex(LayerViewGLPanel.getScreenQuad());
    GLTools.glCheckError("Drawing textured quad");

    GL30.glBindVertexArray(0); // unbind VAO
    GLTools.glCheckError("exiting Text rendering");
    glBindTexture(GL_TEXTURE_2D, 0); // unbind texture

}

From source file:fr.mcnanotech.kevin_68.nanotechmod.city.client.renderer.tileentity.TileEntityFountainRender.java

License:Creative Commons License

public void renderTileEntitySpotLightAt(TileEntityFountain tileentity, double x, double y, double z,
        float par8) {
    float f1 = tileentity.func_82125_v_();

    if (f1 > 0.0F) {
        Tessellator tessellator = Tessellator.instance;
        this.bindTexture(texture);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_BLEND);/*from   w  w w  .j  a v  a 2 s.  c om*/
        GL11.glDepthMask(true);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        tessellator.setColorRGBA(255, 255, 255, 32);
        float f2 = (float) (tileentity.getWorldObj().getTotalWorldTime() / 2) + par8;
        float f22;
        if (tileentity.rotate) {
            f22 = ((f2 - par8) * 2) + par8;
        } else {
            f22 = 1.0F;
        }
        float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
        byte b0 = 1;
        double d3 = (double) f22 * 0.025D * (1.0D - (double) (b0 & 1) * 2.5D);
        tessellator.startDrawingQuads();
        double d4 = (double) b0 * tileentity.getWidth();
        double d5 = 0.5D + Math.cos(d3 + 2.356194490192345D) * d4;
        double d6 = 0.5D + Math.sin(d3 + 2.356194490192345D) * d4;
        double d7 = 0.5D + Math.cos(d3 + (Math.PI / 4D)) * d4;
        double d8 = 0.5D + Math.sin(d3 + (Math.PI / 4D)) * d4;
        double d9 = 0.5D + Math.cos(d3 + 3.9269908169872414D) * d4;
        double d10 = 0.5D + Math.sin(d3 + 3.9269908169872414D) * d4;
        double d11 = 0.5D + Math.cos(d3 + 5.497787143782138D) * d4;
        double d12 = 0.5D + Math.sin(d3 + 5.497787143782138D) * d4;
        double d13;

        d13 = (double) (tileentity.f * f1);

        double d14 = 0.0D;
        double d15 = 1.0D;
        double d16 = (double) (-1.0F + f3);
        double d17 = (double) (tileentity.f * f1) * (0.5D / d4) + d16;
        tessellator.addVertexWithUV(x + d7, y, z + d8, d14, d16);
        tessellator.addVertexWithUV(x + d7, y + d13, z + d8, d14, d17);
        tessellator.addVertexWithUV(x + d9, y, z + d10, d14, d16);
        tessellator.addVertexWithUV(x + d9, y + d13, z + d10, d14, d17);
        tessellator.addVertexWithUV(x + d7, y + d13, z + d8, d15, d17);
        tessellator.addVertexWithUV(x + d7, y, z + d8, d15, d16);
        tessellator.addVertexWithUV(x + d9, y + d13, z + d10, d15, d17);
        tessellator.addVertexWithUV(x + d9, y, z + d10, d15, d16);

        tessellator.addVertexWithUV(x + d5, y + d13, z + d6, d15, d17);
        tessellator.addVertexWithUV(x + d5, y, z + d6, d15, d16);
        tessellator.addVertexWithUV(x + d11, y + d13, z + d12, d15, d17);
        tessellator.addVertexWithUV(x + d11, y, z + d12, d15, d16);
        tessellator.addVertexWithUV(x + d11, y, z + d12, d14, d16);
        tessellator.addVertexWithUV(x + d11, y + d13, z + d12, d14, d17);
        tessellator.addVertexWithUV(x + d5, y, z + d6, d14, d16);
        tessellator.addVertexWithUV(x + d5, y + d13, z + d6, d14, d17);
        tessellator.draw();
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDepthMask(true);
    }
}

From source file:fr.mcnanotech.kevin_68.nanotechmod.city.client.renderer.tileentity.TileEntitySpotLightRender.java

License:Creative Commons License

public void renderTileEntitySpotLightAt(TileEntitySpotLight tileentity, double x, double y, double z,
        float tick) {
    float f1 = tileentity.isActive();
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
    if (f1 > 0.0F) {
        Tessellator tessellator = Tessellator.instance;
        this.bindTexture(texture);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_BLEND);/*  w w  w  .ja v a 2  s.  c  om*/
        GL11.glDepthMask(true);
        OpenGlHelper.glBlendFunc(770, 1, 1, 0);
        tessellator.startDrawingQuads();
        tessellator.setColorRGBA(tileentity.get(TileEntitySpotLight.RED),
                tileentity.get(TileEntitySpotLight.GREEN), tileentity.get(TileEntitySpotLight.BLUE), 32);
        float f2 = (float) tileentity.getWorldObj().getTotalWorldTime() + tick;
        float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
        byte b0 = 1;
        double d4 = (double) b0 * 0.2D;// taille
        double d3 = (double) f2 * 0.025D * (1.0D - (double) (b0 & 1) * 2.5D);

        double angle1Deg = tileentity.get(TileEntitySpotLight.ANGLE1);
        double angle2Deg = tileentity.get(TileEntitySpotLight.ANGLE2);
        double a1 = Math.toRadians(angle1Deg);
        double a2 = tileentity.get(TileEntitySpotLight.AUTOROTATE) == 0
                ? ((d3 * (tileentity.get(TileEntitySpotLight.ROTATIONSPEED) / 10))
                        * (tileentity.get(TileEntitySpotLight.REVERSEROTATION) == 0 ? -1 : 1))
                : Math.toRadians(angle2Deg);

        double xo = 0.5D;
        double yo = 0.5D;
        double zo = 0.5D;
        double xm = xo + (256 * Math.cos(a2) * Math.sin(a1));
        double ym = yo + (256 * Math.cos(a1));
        double zm = zo + (256 * Math.sin(a2) * Math.sin(a1));

        double xa = xo + (0.2D * Math.cos(a2 + (Math.PI / 4D)) * Math.sin(a1 + (Math.PI / 4D)));
        double ya = xo + (0.2D * Math.cos(a1 + (Math.PI / 4D)));
        double za = zo + (0.2D * Math.sin(a2 + (Math.PI / 4D)) * Math.sin(a1 + (Math.PI / 4D)));

        double xA = xa + xm - xo;
        double yA = ya + ym - yo;
        double zA = za + zm - zo;

        double xb = xo + (0.2D * Math.cos(a2 + (3 * Math.PI / 4D)) * Math.sin(a1 + (3 * Math.PI / 4D)));
        double yb = xo + (0.2D * Math.cos(a1 + (3 * Math.PI / 4D)));
        double zb = zo + (0.2D * Math.sin(a2 + (3 * Math.PI / 4D)) * Math.sin(a1 + (3 * Math.PI / 4D)));

        double xB = xb + xm - xo;
        double yB = yb + ym - yo;
        double zB = zb + zm - zo;

        double xc = xo + (0.2D * Math.cos(a2 + (3 * Math.PI / 4D)) * Math.sin(a1 + (5 * Math.PI / 4D)));
        double yc = xo + (0.2D * Math.cos(a1 + (5 * Math.PI / 4D)));
        double zc = zo + (0.2D * Math.sin(a2 + (3 * Math.PI / 4D)) * Math.sin(a1 + (5 * Math.PI / 4D)));

        double xC = xc + xm - xo;
        double yC = yc + ym - yo;
        double zC = zc + zm - zo;

        double xd = xo + (0.2D * Math.cos(a2 + (Math.PI / 4D)) * Math.sin(a1 + (7 * Math.PI / 4D)));
        double yd = xo + (0.2D * Math.cos(a1 + (7 * Math.PI / 4D)));
        double zd = zo + (0.2D * Math.sin(a2 + (Math.PI / 4D)) * Math.sin(a1 + (7 * Math.PI / 4D)));

        double xD = xd + xm - xo;
        double yD = yd + ym - yo;
        double zD = zd + zm - zo;

        double t0 = 0.0D;
        double t1 = 1.0D;
        double t2 = (double) (-1.0F + f3);
        double t3 = (double) (256.0F * f1) * (0.5D / d4) + t2;

        tessellator.addVertexWithUV(x + xa, y + ya, z + za, t1, t3);
        tessellator.addVertexWithUV(x + xA, y + yA, z + zA, t1, t2);
        tessellator.addVertexWithUV(x + xB, y + yB, z + zB, t0, t2);
        tessellator.addVertexWithUV(x + xb, y + yb, z + zb, t0, t3);

        tessellator.addVertexWithUV(x + xa, y + ya, z + za, t1, t3);
        tessellator.addVertexWithUV(x + xA, y + yA, z + zA, t1, t2);
        tessellator.addVertexWithUV(x + xC, y + yC, z + zC, t0, t2);
        tessellator.addVertexWithUV(x + xc, y + yc, z + zc, t0, t3);

        tessellator.addVertexWithUV(x + xc, y + yc, z + zc, t1, t3);
        tessellator.addVertexWithUV(x + xC, y + yC, z + zC, t1, t2);
        tessellator.addVertexWithUV(x + xD, y + yD, z + zD, t0, t2);
        tessellator.addVertexWithUV(x + xd, y + yd, z + zd, t0, t3);

        tessellator.addVertexWithUV(x + xb, y + yb, z + zb, t1, t3);
        tessellator.addVertexWithUV(x + xB, y + yB, z + zB, t1, t2);
        tessellator.addVertexWithUV(x + xD, y + yD, z + zD, t0, t2);
        tessellator.addVertexWithUV(x + xd, y + yd, z + zd, t0, t3);

        tessellator.addVertexWithUV(x + xb, y + yb, z + zb, t1, t3);
        tessellator.addVertexWithUV(x + xB, y + yB, z + zB, t1, t2);
        tessellator.addVertexWithUV(x + xC, y + yC, z + zC, t0, t2);
        tessellator.addVertexWithUV(x + xc, y + yc, z + zc, t0, t3);

        tessellator.addVertexWithUV(x + xa, y + ya, z + za, t1, t3);
        tessellator.addVertexWithUV(x + xA, y + yA, z + zA, t1, t2);
        tessellator.addVertexWithUV(x + xD, y + yD, z + zD, t0, t2);
        tessellator.addVertexWithUV(x + xd, y + yd, z + zd, t0, t3);
        tessellator.draw();

        GL11.glEnable(GL11.GL_BLEND);
        OpenGlHelper.glBlendFunc(770, 771, 1, 0);
        GL11.glDepthMask(false);

        double xe = xo + (0.5D * Math.cos(a2 + (Math.PI / 4D)) * Math.sin(a1 + (Math.PI / 4D)));
        double ye = xo + (0.5D * Math.cos(a1 + (Math.PI / 4D)));
        double ze = zo + (0.5D * Math.sin(a2 + (Math.PI / 4D)) * Math.sin(a1 + (Math.PI / 4D)));

        double xE = xe + xm - xo;
        double yE = ye + ym - yo;
        double zE = ze + zm - zo;

        double xf = xo + (0.5D * Math.cos(a2 + (3 * Math.PI / 4D)) * Math.sin(a1 + (3 * Math.PI / 4D)));
        double yf = xo + (0.5D * Math.cos(a1 + (3 * Math.PI / 4D)));
        double zf = zo + (0.5D * Math.sin(a2 + (3 * Math.PI / 4D)) * Math.sin(a1 + (3 * Math.PI / 4D)));

        double xF = xf + xm - xo;
        double yF = yf + ym - yo;
        double zF = zf + zm - zo;

        double xg = xo + (0.5D * Math.cos(a2 + (3 * Math.PI / 4D)) * Math.sin(a1 + (5 * Math.PI / 4D)));
        double yg = xo + (0.5D * Math.cos(a1 + (5 * Math.PI / 4D)));
        double zg = zo + (0.5D * Math.sin(a2 + (3 * Math.PI / 4D)) * Math.sin(a1 + (5 * Math.PI / 4D)));

        double xG = xg + xm - xo;
        double yG = yg + ym - yo;
        double zG = zg + zm - zo;

        double xh = xo + (0.5D * Math.cos(a2 + (Math.PI / 4D)) * Math.sin(a1 + (7 * Math.PI / 4D)));
        double yh = xo + (0.5D * Math.cos(a1 + (7 * Math.PI / 4D)));
        double zh = zo + (0.5D * Math.sin(a2 + (Math.PI / 4D)) * Math.sin(a1 + (7 * Math.PI / 4D)));

        double xH = xh + xm - xo;
        double yH = yh + ym - yo;
        double zH = zh + zm - zo;

        if (tileentity.get(TileEntitySpotLight.SECONDARYLAZER) == 0) {
            tessellator.startDrawingQuads();
            tessellator.setColorRGBA(tileentity.get(TileEntitySpotLight.DARKRED),
                    tileentity.get(TileEntitySpotLight.DARKGREEN), tileentity.get(TileEntitySpotLight.DARKBLUE),
                    32);

            tessellator.addVertexWithUV(x + xe, y + ye, z + ze, t1, t3);
            tessellator.addVertexWithUV(x + xE, y + yE, z + zE, t1, t2);
            tessellator.addVertexWithUV(x + xF, y + yF, z + zF, t0, t2);
            tessellator.addVertexWithUV(x + xf, y + yf, z + zf, t0, t3);

            tessellator.addVertexWithUV(x + xe, y + ye, z + ze, t1, t3);
            tessellator.addVertexWithUV(x + xE, y + yE, z + zE, t1, t2);
            tessellator.addVertexWithUV(x + xG, y + yG, z + zG, t0, t2);
            tessellator.addVertexWithUV(x + xg, y + yg, z + zg, t0, t3);

            tessellator.addVertexWithUV(x + xg, y + yg, z + zg, t1, t3);
            tessellator.addVertexWithUV(x + xG, y + yG, z + zG, t1, t2);
            tessellator.addVertexWithUV(x + xH, y + yH, z + zH, t0, t2);
            tessellator.addVertexWithUV(x + xh, y + yh, z + zh, t0, t3);

            tessellator.addVertexWithUV(x + xf, y + yf, z + zf, t1, t3);
            tessellator.addVertexWithUV(x + xF, y + yF, z + zF, t1, t2);
            tessellator.addVertexWithUV(x + xH, y + yH, z + zH, t0, t2);
            tessellator.addVertexWithUV(x + xh, y + yh, z + zh, t0, t3);

            tessellator.addVertexWithUV(x + xf, y + yf, z + zf, t1, t3);
            tessellator.addVertexWithUV(x + xF, y + yF, z + zF, t1, t2);
            tessellator.addVertexWithUV(x + xG, y + yG, z + zG, t0, t2);
            tessellator.addVertexWithUV(x + xg, y + yg, z + zg, t0, t3);

            tessellator.addVertexWithUV(x + xe, y + ya, z + za, t1, t3);
            tessellator.addVertexWithUV(x + xE, y + yE, z + zE, t1, t2);
            tessellator.addVertexWithUV(x + xD, y + yD, z + zD, t0, t2);
            tessellator.addVertexWithUV(x + xd, y + yd, z + zd, t0, t3);
            tessellator.draw();
        }

        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDepthMask(true);
    }
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F);
}

From source file:fr.mcnanotech.kevin_68.nanotechmod.city.client.renderer.tileentity.TileEntityTextSpotLightRender.java

License:Creative Commons License

public void renderTileEntitySignAt(TileEntityTextSpotLight tileentity, double par2, double par4, double par6,
        float par8) {
    float f = tileentity.isActiveFloat();
    if (f > 0.0F) {
        GL11.glPushMatrix();// ww w .j  a va 2  s  .c om
        float f1 = 0.6666667F;
        float f2 = 0.0F;

        float d2 = (float) tileentity.getWorldObj().getTotalWorldTime() + par8;
        byte b1 = 1;
        double d3 = (double) d2 * 0.025D * (1.0D - (double) (b1 & 1) * 2.5D);
        int i1 = (tileentity.get(TileEntityTextSpotLight.REVERSEROTATION) == 1 ? -1 : 1);

        GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.75F * f1, (float) par6 + 0.5F);
        GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.4F, 0.0F);
        GL11.glScaled(0.9D, 0.9D, 0.9D);
        if (tileentity.get(TileEntityTextSpotLight.ROTATE) == 0) {
            GL11.glRotated(d3 * 5 * tileentity.get(TileEntityTextSpotLight.ROTATIONSPEED) * i1, 0.0F, 1.0F,
                    0.0F);
        } else {
            GL11.glRotatef(tileentity.get(TileEntityTextSpotLight.ANGLE), 0.0F, 1.0F, 0.0F);
        }
        this.modelSign.signStick.showModel = false;

        this.bindTexture(field_110638_a);
        GL11.glPushMatrix();
        GL11.glScalef(f1, -f1, -f1);
        this.modelSign.renderSign();
        GL11.glPopMatrix();
        FontRenderer fontrenderer = this.func_147498_b();
        f2 = 0.016666668F * f1;
        GL11.glTranslatef(0.0F, 0.5F * f1, 0.07F * f1);
        GL11.glScalef(f2 * 5, -f2 * 5, f2 * 5);
        GL11.glNormal3f(0.0F, 0.0F, -1.0F * f2);
        GL11.glDepthMask(false);

        GL11.glTranslated(0.0F, -tileentity.get(TileEntityTextSpotLight.HEIGHT), 0.0F);
        // GL11.glTranslated(0.0F, tileentity.getScale() / 5.0F, 0.0F);
        GL11.glScaled(1.0 + (1.0 * (tileentity.get(TileEntityTextSpotLight.SCALE) / 10)),
                1.0 + (1.0 * (tileentity.get(TileEntityTextSpotLight.SCALE) / 10)),
                1.0 + (1.0 * (tileentity.get(TileEntityTextSpotLight.SCALE) / 10)));

        String s = tileentity.signText;
        fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, -20,
                (tileentity.get(TileEntityTextSpotLight.RED) * 65536)
                        + (tileentity.get(TileEntityTextSpotLight.GREEN) * 256)
                        + tileentity.get(TileEntityTextSpotLight.BLUE));
        // GL11.glRotatef(180, 0.0F, 1.0F, 0.0F);
        // fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2,
        // -20, (tileentity.getRedValue() * 65536) +
        // (tileentity.getGreenValue() * 256) + tileentity.getBlueValue());

        GL11.glDepthMask(true);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glPopMatrix();
    }
}

From source file:fr.mcnanotech.kevin_68.nanotechmod.main.event.RenderEvent.java

License:Creative Commons License

@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent event) {
    if (event.isCancelable() || event.type != ElementType.EXPERIENCE) {
        return;/*from w ww  .  j  a v a2 s . c  o  m*/
    } else {
        ItemStack stack = this.mc.thePlayer.inventory.armorItemInSlot(3);
        if (this.mc.gameSettings.thirdPersonView == 0 && stack != null
                && stack.getItem().equals(NanotechItem.crazyGlasses)) {
            int k = event.resolution.getScaledWidth();
            int l = event.resolution.getScaledHeight();
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_DEPTH_TEST);
            GL11.glDepthMask(false);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            this.mc.renderEngine.bindTexture(texture);
            Tessellator tessellator = Tessellator.instance;
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(0.0D, (double) l, -90.0D, 0.0D, 1.0D);
            tessellator.addVertexWithUV((double) k, (double) l, -90.0D, 1.0D, 1.0D);
            tessellator.addVertexWithUV((double) k, 0.0D, -90.0D, 1.0D, 0.0D);
            tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D);
            tessellator.draw();
            GL11.glDepthMask(true);
            GL11.glEnable(GL11.GL_DEPTH_TEST);
            GL11.glEnable(GL11.GL_ALPHA_TEST);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        }
    }
}

From source file:gravestone.models.block.memorials.ModelCreeperStatueMemorial.java

License:LGPL

private void renderCreeperCharging() {
    float tickModifier = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 48.0F;
    float scale = 1.2F;
    float f4 = 0.5F;

    GL11.glTranslated(0, -0.5, 0);/*w w w  .  ja  v a 2 s  .  co m*/
    GL11.glScalef(scale, scale, scale);
    TileEntityGSMemorialRenderer.instance.bindTextureByName(Resources.CREEPER_AURA);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
    GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
    GL11.glMatrixMode(GL11.GL_TEXTURE);

    for (int var21 = 0; var21 < 3; ++var21) {
        GL11.glLoadIdentity();
        float var23 = tickModifier * (0.001F + (float) var21 * 0.0015F) * 15;
        GL11.glTranslatef(0, var23, 0);
        renderCreeper();
    }

    GL11.glMatrixMode(GL11.GL_TEXTURE);
    GL11.glLoadIdentity();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthFunc(GL11.GL_LEQUAL);
    GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);

    GL11.glTranslated(0, -0.19, 0);
}

From source file:gravestone.models.block.ModelGraveStone.java

License:LGPL

protected void renderEnchantment() {
    float tickModifier = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 48.0F;
    TileEntityGSGraveStoneRenderer.instance.bindTextureByName(Resources.SWORD_AURA);

    GL11.glEnable(GL11.GL_BLEND);/*w  w w .ja  v a  2s  .c  om*/
    GL11.glDepthMask(true);
    GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
    GL11.glMatrixMode(GL11.GL_TEXTURE);

    for (int var21 = 0; var21 < 3; var21++) {
        GL11.glDisable(GL11.GL_LIGHTING);
        float var22 = 0.76F;
        GL11.glColor4f(0.5F * var22, 0.25F * var22, 0.8F * var22, 1.0F);
        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glLoadIdentity();
        float var23 = tickModifier * (0.001F + (float) var21 * 0.0015F) * 15;
        float var24 = 0.33333334F;
        GL11.glScalef(var24, var24, var24);
        GL11.glRotatef(30 - (float) var21 * 60, 0, 0, 1);
        GL11.glTranslatef(0, var23, 0);
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        renderAll();
    }

    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);
}

From source file:hellfirepvp.astralsorcery.client.effect.fx.EntityFXFacingParticle.java

License:Open Source License

public static void renderFast(float parTicks, List<EntityFXFacingParticle> particles) {
    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    GL11.glDisable(GL11.GL_ALPHA_TEST);//from   w  w  w.  j  av  a 2  s.  c  o  m
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDepthMask(false);

    staticFlareTex.bind();

    Tessellator t = Tessellator.getInstance();
    VertexBuffer vb = t.getBuffer();
    vb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);

    for (EntityFXFacingParticle particle : new ArrayList<>(particles)) {
        if (particle == null)
            continue;
        particle.renderFast(parTicks, vb);
    }

    t.draw();

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glPopAttrib();
}

From source file:hellfirepvp.astralsorcery.client.effect.fx.EntityFXFacingParticle.java

License:Open Source License

@Override
public void render(float pTicks) {
    GL11.glDisable(GL11.GL_ALPHA_TEST);// w  ww  . java 2  s .co m
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDepthMask(false);
    float alpha = fadeFunction.getAlpha(age, maxAge);
    alpha *= alphaMultiplier;
    GL11.glColor4f(colorRed, colorGreen, colorBlue, alpha);
    staticFlareTex.bind();
    RenderingUtils.renderFacingQuad(interpolate(oldX, x, pTicks), interpolate(oldY, y, pTicks),
            interpolate(oldZ, z, pTicks), pTicks, scale, 0, 0, 0, 1, 1);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_CULL_FACE);
}

From source file:hellfirepvp.astralsorcery.client.effect.fx.EntityFXFacingSprite.java

License:Open Source License

@Override
public void render(float pTicks) {
    GL11.glDisable(GL11.GL_ALPHA_TEST);/* w  w  w. ja  v  a 2  s .c  o  m*/
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(false);
    GL11.glColor4f(1F, 1F, 1F, 1F);
    int frame = getAgeBasedFrame();
    Tuple<Double, Double> uv = spriteSheet.getUVOffset(frame);
    spriteSheet.getResource().bind();
    double iX = RenderingUtils.interpolate(prevX, x, pTicks);
    double iY = RenderingUtils.interpolate(prevY, y, pTicks);
    double iZ = RenderingUtils.interpolate(prevZ, z, pTicks);
    RenderingUtils.renderFacingQuad(iX, iY, iZ, pTicks, scale, 0, uv.key, uv.value,
            spriteSheet.getULength() * getULengthMultiplier(),
            spriteSheet.getVLength() * getVLengthMultiplier());
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_CULL_FACE);
}