Example usage for org.lwjgl.opengl GL11 glDepthFunc

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

Introduction

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

Prototype

public static void glDepthFunc(@NativeType("GLenum") int func) 

Source Link

Document

Specifies the comparison that takes place during the depth buffer test (when GL11C#GL_DEPTH_TEST DEPTH_TEST is enabled).

Usage

From source file:net.smert.frameworkgl.opengl.OpenGL1.java

License:Apache License

public OpenGL1 setDepthFuncLess() {
    GL11.glDepthFunc(DepthFunctions.LESS);
    return this;
}

From source file:net.smert.frameworkgl.opengl.OpenGL1.java

License:Apache License

public OpenGL1 setDepthFuncLessEqual() {
    GL11.glDepthFunc(DepthFunctions.LEQUAL);
    return this;
}

From source file:net.smert.frameworkgl.opengl.OpenGL1.java

License:Apache License

public OpenGL1 setDepthFuncNever() {
    GL11.glDepthFunc(DepthFunctions.NEVER);
    return this;
}

From source file:net.smert.frameworkgl.opengl.OpenGL1.java

License:Apache License

public OpenGL1 setDepthFuncNotEqual() {
    GL11.glDepthFunc(DepthFunctions.NOTEQUAL);
    return this;
}

From source file:org.blockartistry.mod.DynSurround.client.fx.particle.EntityTextPopOffFX.java

License:MIT License

@Override
public void renderParticle(final WorldRenderer renderer, final Entity entity, final float x, final float y,
        final float z, final float dX, final float dY, final float dZ) {
    this.rotationYaw = (-Minecraft.getMinecraft().thePlayer.rotationYaw);
    this.rotationPitch = Minecraft.getMinecraft().thePlayer.rotationPitch;

    final float locX = ((float) (this.prevPosX + (this.posX - this.prevPosX) * x - interpPosX));
    final float locY = ((float) (this.prevPosY + (this.posY - this.prevPosY) * y - interpPosY));
    final float locZ = ((float) (this.prevPosZ + (this.posZ - this.prevPosZ) * z - interpPosZ));

    GL11.glPushMatrix();//from w  w w  .  j  a  v  a 2 s  . c  o m
    if (this.shouldOnTop) {
        GL11.glDepthFunc(519);
    } else {
        GL11.glDepthFunc(515);
    }
    GL11.glTranslatef(locX, locY, locZ);
    GL11.glRotatef(this.rotationYaw, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(this.rotationPitch, 1.0F, 0.0F, 0.0F);

    GL11.glScalef(-1.0F, -1.0F, 1.0F);
    GL11.glScaled(this.particleScale * 0.008D, this.particleScale * 0.008D, this.particleScale * 0.008D);
    GL11.glScaled(this.scale, this.scale, this.scale);

    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 0.003662109F);
    GL11.glEnable(3553);
    GL11.glDisable(3042);
    GL11.glDepthMask(true);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glEnable(3553);
    GL11.glEnable(2929);
    GL11.glDisable(2896);
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(3042);
    GL11.glEnable(3008);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj;
    fontRenderer.drawStringWithShadow(this.text,
            -MathHelper.floor_float(fontRenderer.getStringWidth(this.text) / 2.0F) + 1,
            -MathHelper.floor_float(fontRenderer.FONT_HEIGHT / 2.0F) + 1, this.renderColor.rgb());

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDepthFunc(515);

    GL11.glPopMatrix();
    if (this.grow) {
        this.particleScale *= 1.08F;
        if (this.particleScale > SIZE * 3.0D) {
            this.grow = false;
        }
    } else {
        this.particleScale *= 0.96F;
    }
}

From source file:org.blockartistry.mod.DynSurround.client.fx.particle.ParticleTextPopOff.java

License:MIT License

@Override
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX,
        float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
    this.rotationYaw = (-Minecraft.getMinecraft().thePlayer.rotationYaw);
    this.rotationPitch = Minecraft.getMinecraft().thePlayer.rotationPitch;

    final float locX = ((float) (this.prevPosX + (this.posX - this.prevPosX) * partialTicks - interpPosX));
    final float locY = ((float) (this.prevPosY + (this.posY - this.prevPosY) * partialTicks - interpPosY));
    final float locZ = ((float) (this.prevPosZ + (this.posZ - this.prevPosZ) * partialTicks - interpPosZ));

    GL11.glPushMatrix();/*w  w  w .ja  v a 2 s.  c o  m*/
    if (this.showOnTop) {
        GL11.glDepthFunc(519);
    } else {
        GL11.glDepthFunc(515);
    }
    GL11.glTranslatef(locX, locY, locZ);
    GL11.glRotatef(this.rotationYaw, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(this.rotationPitch, 1.0F, 0.0F, 0.0F);

    GL11.glScalef(-1.0F, -1.0F, 1.0F);
    GL11.glScaled(this.particleScale * 0.008D, this.particleScale * 0.008D, this.particleScale * 0.008D);
    GL11.glScaled(this.scale, this.scale, this.scale);

    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 0.003662109F);
    GL11.glEnable(3553);
    GL11.glDisable(3042);
    GL11.glDepthMask(true);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glEnable(3553);
    GL11.glEnable(2929);
    GL11.glDisable(2896);
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(3042);
    GL11.glEnable(3008);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj;
    fontRenderer.drawStringWithShadow(this.text,
            -MathHelper.floor_float(fontRenderer.getStringWidth(this.text) / 2.0F) + 1,
            -MathHelper.floor_float(fontRenderer.FONT_HEIGHT / 2.0F) + 1, this.renderColor.rgb());

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDepthFunc(515);

    GL11.glPopMatrix();
    if (this.grow) {
        this.particleScale *= 1.08F;
        if (this.particleScale > SIZE * 3.0D) {
            this.grow = false;
        }
    } else {
        this.particleScale *= 0.96F;
    }
}

From source file:org.craftmania.world.characters.Player.java

License:Apache License

@Override
public void render() {

    GL11.glEnable(GL11.GL_DEPTH_TEST);/*ww  w.j  a v  a  2  s. com*/
    GL11.glDepthFunc(GL11.GL_LEQUAL);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);

    if (_aimedBlockPosition.y() != -1) {
        GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
        GL11.glDisable(GL11.GL_TEXTURE_2D);

        _aimedBlockAABB.render(0.0f, 0.0f, 0.0f, 0.1f);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }

    if (_selectedItem != null) {
        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_CULL_FACE);

        _body.transformToRightHand();

        /* Prepare the light buffer */
        Chunk c = Game.getInstance().getWorld().getChunkManager().getChunkContaining(
                MathHelper.floor(_position.x()), MathHelper.floor(_position.y()) + 1,
                MathHelper.floor(_position.z()), false, false, false);
        if (c != null) {
            c.getLightBuffer().setReferencePoint(MathHelper.floor(_position.x()),
                    MathHelper.floor(_position.y()) + 1, MathHelper.floor(_position.z()));

            /* Render the object, with the lightbuffer */
            _selectedItem.renderHoldableObject(c.getLightBuffer());
        }

        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glPopMatrix();
    }
    GL11.glDisable(GL11.GL_DEPTH_TEST);
}

From source file:org.fenggui.binding.render.lwjgl.LWJGLOpenGL.java

License:Open Source License

public void setDepthFunctionToLEqual() { // XXX: special case function...
    GL11.glDepthFunc(GL11.GL_LEQUAL);
}

From source file:org.free.jake2.render.lwjgl.Main.java

License:Open Source License

/**
 * R_Clear// w  w w. j  a  va2 s. c  o  m
 */
void R_Clear() {
    if (gl_ztrick.value != 0.0f) {

        if (gl_clear.value != 0.0f) {
            GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
        }

        trickframe++;
        if ((trickframe & 1) != 0) {
            gldepthmin = 0;
            gldepthmax = 0.49999f;
            GL11.glDepthFunc(GL11.GL_LEQUAL);
        } else {
            gldepthmin = 1;
            gldepthmax = 0.5f;
            GL11.glDepthFunc(GL11.GL_GEQUAL);
        }
    } else {
        if (gl_clear.value != 0.0f) {
            GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
        } else {
            GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
        }

        gldepthmin = 0;
        gldepthmax = 1;
        GL11.glDepthFunc(GL11.GL_LEQUAL);
    }
    GL11.glDepthRange(gldepthmin, gldepthmax);
}

From source file:org.getspout.spout.gui.GenericItemWidget.java

License:Open Source License

@Override
public void render() {
    if (toRender == null) {
        if (getTypeId() > 0) {
            if (getData() > -1) {
                toRender = new ItemStack(getTypeId(), 1, getData());
            } else {
                toRender = new ItemStack(getTypeId(), 1, 0);
            }//from   ww w  . ja  va 2s. co  m
        }
    }
    if (toRender != null) {
        GL11.glDepthFunc(515);
        RenderHelper.enableStandardItemLighting();
        GL11.glDisable(GL11.GL_DEPTH_TEST);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_COLOR_MATERIAL);
        GL11.glDisable(GL11.GL_LIGHTING);
        double oldX = 1;
        double oldY = 1;
        double oldZ = 1;
        Block block = null;
        if (getTypeId() < 255) {
            block = Block.blocksList[getTypeId()];
            oldX = block.maxX;
            oldY = block.maxY;
            oldZ = block.maxZ;
            block.maxX = block.maxX * (width / 8);
            block.maxY = block.maxY * (height / 8);
            block.maxZ = block.maxZ * (getDepth() / 8);
        } else {
            renderer.setScale(1 + (getWidth() / 200D), 1 + (getHeight() / 200D), 1);
        }
        GL11.glPushMatrix();
        GL11.glTranslatef((float) getScreenX(), (float) getScreenY(), 0);
        GL11.glScalef((float) (screen.getWidth() / 427f), (float) (screen.getHeight() / 240f), 1);
        renderer.renderItemIntoGUI(SpoutClient.getHandle().fontRenderer, SpoutClient.getHandle().renderEngine,
                toRender, 0, 0);
        GL11.glPopMatrix();
        if (getTypeId() < 255) {
            block.maxX = oldX;
            block.maxY = oldY;
            block.maxZ = oldZ;
        }
        GL11.glEnable(GL11.GL_DEPTH_TEST);
        GL11.glEnable(GL11.GL_LIGHTING);
        RenderHelper.disableStandardItemLighting();
    }
}