Java 类org.lwjgl.opengl.GL30 实例源码

项目:MRCEngine    文件:EntityRenderer.java   
private void prepareTexturedModel(TexturedModel model) {
    RawModel rawModel = model.getRawModel();
    GL30.glBindVertexArray(rawModel.getVaoID());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);

    ModelTexture texture = model.getTexture();

    if(texture.isHasTransparency()) {
        MasterRenderer.disableCulling();
    }

    shader.loadFakeLightingVariable(texture.isUseFakeLighting());
    shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());

    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
项目:Backmemed    文件:OpenGlHelper.java   
public static void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;

            case ARB:
                ARBFramebufferObject.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;

            case EXT:
                EXTFramebufferObject.glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
        }
    }
}
项目:open-world    文件:WaterRegion.java   
/**
    * Renders the world to the water framebuffer.
    * @param worldCamera
    * @param world
    */
   public void preRender(final PerspectiveCamera camera, final World world) {
GL11.glEnable(GL30.GL_CLIP_DISTANCE0);
framebuffer.bind();
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);

// Render to reflection texture.
float verticalDistance = camera.getPosition().y - WATER_HEIGHT;
camera.getPosition().y -= verticalDistance * 2;
camera.invertPitch();
camera.update();
world.renderWithoutWater(camera, true);
camera.invertPitch();
camera.getPosition().y += verticalDistance * 2;
camera.update();

FrameBuffer.unbind();
GL11.glDisable(GL30.GL_CLIP_DISTANCE0);
   }
项目:CustomWorldGen    文件:OpenGlHelper.java   
/**
 * Calls the appropriate glGenFramebuffers method and returns the newly created fbo, or returns -1 if not supported.
 */
public static int glGenFramebuffers()
{
    if (!framebufferSupported)
    {
        return -1;
    }
    else
    {
        switch (framebufferType)
        {
            case BASE:
                return GL30.glGenFramebuffers();
            case ARB:
                return ARBFramebufferObject.glGenFramebuffers();
            case EXT:
                return EXTFramebufferObject.glGenFramebuffersEXT();
            default:
                return -1;
        }
    }
}
项目:Backmemed    文件:OpenGlHelper.java   
public static void glDeleteRenderbuffers(int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glDeleteRenderbuffers(renderbuffer);
                break;

            case ARB:
                ARBFramebufferObject.glDeleteRenderbuffers(renderbuffer);
                break;

            case EXT:
                EXTFramebufferObject.glDeleteRenderbuffersEXT(renderbuffer);
        }
    }
}
项目:bia-engine    文件:EntityRenderer.java   
private void prepareTexturedModel(final TexturedModel model) {
    GL30.glBindVertexArray(model.getRawModel().getVaoId());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);
    if (model.getTexture().isHasTransparency()) {
        MasterRenderer.disableCulling();
    }
    shader.loadFakeLightingVariable(model.getTexture().isUseFakeLighting());
    shader.loadShineVariables(
            model.getTexture().getShineDamper(),
            model.getTexture().getReflectivity()
    );
    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getTextureId());
}
项目:Backmemed    文件:OpenGlHelper.java   
/**
 * Calls the appropriate glGenFramebuffers method and returns the newly created fbo, or returns -1 if not supported.
 */
public static int glGenFramebuffers()
{
    if (!framebufferSupported)
    {
        return -1;
    }
    else
    {
        switch (framebufferType)
        {
            case BASE:
                return GL30.glGenFramebuffers();

            case ARB:
                return ARBFramebufferObject.glGenFramebuffers();

            case EXT:
                return EXTFramebufferObject.glGenFramebuffersEXT();

            default:
                return -1;
        }
    }
}
项目:Backmemed    文件:OpenGlHelper.java   
public static void glBindFramebuffer(int target, int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glBindFramebuffer(target, framebufferIn);
                break;

            case ARB:
                ARBFramebufferObject.glBindFramebuffer(target, framebufferIn);
                break;

            case EXT:
                EXTFramebufferObject.glBindFramebufferEXT(target, framebufferIn);
        }
    }
}
项目:CustomWorldGen    文件:OpenGlHelper.java   
public static void glBindFramebuffer(int target, int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glBindFramebuffer(target, framebufferIn);
                break;
            case ARB:
                ARBFramebufferObject.glBindFramebuffer(target, framebufferIn);
                break;
            case EXT:
                EXTFramebufferObject.glBindFramebufferEXT(target, framebufferIn);
        }
    }
}
项目:Backmemed    文件:OpenGlHelper.java   
public static void glRenderbufferStorage(int target, int internalFormat, int width, int height)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case ARB:
                ARBFramebufferObject.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case EXT:
                EXTFramebufferObject.glRenderbufferStorageEXT(target, internalFormat, width, height);
        }
    }
}
项目:CustomWorldGen    文件:OpenGlHelper.java   
public static void glFramebufferRenderbuffer(int target, int attachment, int renderBufferTarget, int renderBuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer);
                break;
            case ARB:
                ARBFramebufferObject.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer);
                break;
            case EXT:
                EXTFramebufferObject.glFramebufferRenderbufferEXT(target, attachment, renderBufferTarget, renderBuffer);
        }
    }
}
项目:DecompiledMinecraft    文件:OpenGlHelper.java   
public static void glBindRenderbuffer(int target, int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glBindRenderbuffer(target, renderbuffer);
                break;

            case 1:
                ARBFramebufferObject.glBindRenderbuffer(target, renderbuffer);
                break;

            case 2:
                EXTFramebufferObject.glBindRenderbufferEXT(target, renderbuffer);
        }
    }
}
项目:DecompiledMinecraft    文件:OpenGlHelper.java   
public static void glDeleteRenderbuffers(int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glDeleteRenderbuffers(renderbuffer);
                break;

            case 1:
                ARBFramebufferObject.glDeleteRenderbuffers(renderbuffer);
                break;

            case 2:
                EXTFramebufferObject.glDeleteRenderbuffersEXT(renderbuffer);
        }
    }
}
项目:DecompiledMinecraft    文件:OpenGlHelper.java   
public static void glDeleteFramebuffers(int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glDeleteFramebuffers(framebufferIn);
                break;

            case 1:
                ARBFramebufferObject.glDeleteFramebuffers(framebufferIn);
                break;

            case 2:
                EXTFramebufferObject.glDeleteFramebuffersEXT(framebufferIn);
        }
    }
}
项目:DecompiledMinecraft    文件:OpenGlHelper.java   
public static void glRenderbufferStorage(int target, int internalFormat, int width, int height)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case 1:
                ARBFramebufferObject.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case 2:
                EXTFramebufferObject.glRenderbufferStorageEXT(target, internalFormat, width, height);
        }
    }
}
项目:CustomWorldGen    文件:OpenGlHelper.java   
public static void glBindRenderbuffer(int target, int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glBindRenderbuffer(target, renderbuffer);
                break;
            case ARB:
                ARBFramebufferObject.glBindRenderbuffer(target, renderbuffer);
                break;
            case EXT:
                EXTFramebufferObject.glBindRenderbufferEXT(target, renderbuffer);
        }
    }
}
项目:DecompiledMinecraft    文件:OpenGlHelper.java   
public static int glCheckFramebufferStatus(int target)
{
    if (!framebufferSupported)
    {
        return -1;
    }
    else
    {
        switch (framebufferType)
        {
            case 0:
                return GL30.glCheckFramebufferStatus(target);

            case 1:
                return ARBFramebufferObject.glCheckFramebufferStatus(target);

            case 2:
                return EXTFramebufferObject.glCheckFramebufferStatusEXT(target);

            default:
                return -1;
        }
    }
}
项目:DecompiledMinecraft    文件:OpenGlHelper.java   
public static void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;

            case 1:
                ARBFramebufferObject.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;

            case 2:
                EXTFramebufferObject.glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
        }
    }
}
项目:lambda    文件:Texture.java   
/**
 * Creates an OpenGL texture based on a given Image
 * @param id OpenGL reference id to create texture in
 * @param image 
 */
private void createTexture(int id, Image image) {
    // Set as texture 0
    GL13.glActiveTexture(GL13.GL_TEXTURE0);

    bind();

    // Set pixel storage mode
    GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);

    // Setup texture
    GL11.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    GL11.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

    GL11.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width, image.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.buffer);
    GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D);

    unbind();
}
项目:Backmemed    文件:Shaders.java   
public static void genCompositeMipmap()
{
    if (hasGlGenMipmap)
    {
        for (int i = 0; i < usedColorBuffers; ++i)
        {
            if ((activeCompositeMipmapSetting & 1 << i) != 0)
            {
                GlStateManager.setActiveTexture(33984 + colorTextureTextureImageUnit[i]);
                GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);
                GL30.glGenerateMipmap(3553);
            }
        }

        GlStateManager.setActiveTexture(33984);
    }
}
项目:Voxel_Game    文件:CloudRenderer.java   
public static final void render(final Vec3 position, final float scale) {

        shader.start();

        GL30.glBindVertexArray(model.id);
        GL20.glEnableVertexAttribArray(0);
        GL20.glEnableVertexAttribArray(1);
        GL20.glEnableVertexAttribArray(2);

        shader.loadTransformationMatrix(MatrixCreation.createTransformationMatrix(position, new Vec3(), new Vec3(scale, 1, scale)));
        GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, model.vertexCount);

        GL20.glDisableVertexAttribArray(0);
        GL20.glDisableVertexAttribArray(1);
        GL20.glDisableVertexAttribArray(2);
        GL30.glBindVertexArray(0);

        shader.stop();

    }
项目:CustomWorldGen    文件:OpenGlHelper.java   
public static void glDeleteFramebuffers(int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glDeleteFramebuffers(framebufferIn);
                break;
            case ARB:
                ARBFramebufferObject.glDeleteFramebuffers(framebufferIn);
                break;
            case EXT:
                EXTFramebufferObject.glDeleteFramebuffersEXT(framebufferIn);
        }
    }
}
项目:CustomWorldGen    文件:OpenGlHelper.java   
public static void glDeleteRenderbuffers(int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glDeleteRenderbuffers(renderbuffer);
                break;
            case ARB:
                ARBFramebufferObject.glDeleteRenderbuffers(renderbuffer);
                break;
            case EXT:
                EXTFramebufferObject.glDeleteRenderbuffersEXT(renderbuffer);
        }
    }
}
项目:Backmemed    文件:OpenGlHelper.java   
public static void glFramebufferRenderbuffer(int target, int attachment, int renderBufferTarget, int renderBuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer);
                break;

            case ARB:
                ARBFramebufferObject.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer);
                break;

            case EXT:
                EXTFramebufferObject.glFramebufferRenderbufferEXT(target, attachment, renderBufferTarget, renderBuffer);
        }
    }
}
项目:CustomWorldGen    文件:OpenGlHelper.java   
public static void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;
            case ARB:
                ARBFramebufferObject.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;
            case EXT:
                EXTFramebufferObject.glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glBindFramebuffer(int target, int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glBindFramebuffer(target, framebufferIn);
                break;

            case 1:
                ARBFramebufferObject.glBindFramebuffer(target, framebufferIn);
                break;

            case 2:
                EXTFramebufferObject.glBindFramebufferEXT(target, framebufferIn);
        }
    }
}
项目:CustomWorldGen    文件:OpenGlHelper.java   
public static void glRenderbufferStorage(int target, int internalFormat, int width, int height)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glRenderbufferStorage(target, internalFormat, width, height);
                break;
            case ARB:
                ARBFramebufferObject.glRenderbufferStorage(target, internalFormat, width, height);
                break;
            case EXT:
                EXTFramebufferObject.glRenderbufferStorageEXT(target, internalFormat, width, height);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glDeleteRenderbuffers(int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glDeleteRenderbuffers(renderbuffer);
                break;

            case 1:
                ARBFramebufferObject.glDeleteRenderbuffers(renderbuffer);
                break;

            case 2:
                EXTFramebufferObject.glDeleteRenderbuffersEXT(renderbuffer);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glDeleteFramebuffers(int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glDeleteFramebuffers(framebufferIn);
                break;

            case 1:
                ARBFramebufferObject.glDeleteFramebuffers(framebufferIn);
                break;

            case 2:
                EXTFramebufferObject.glDeleteFramebuffersEXT(framebufferIn);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
/**
 * Calls the appropriate glGenFramebuffers method and returns the newly created fbo, or returns -1 if not supported.
 */
public static int glGenFramebuffers()
{
    if (!framebufferSupported)
    {
        return -1;
    }
    else
    {
        switch (framebufferType)
        {
            case 0:
                return GL30.glGenFramebuffers();

            case 1:
                return ARBFramebufferObject.glGenFramebuffers();

            case 2:
                return EXTFramebufferObject.glGenFramebuffersEXT();

            default:
                return -1;
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glRenderbufferStorage(int target, int internalFormat, int width, int height)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case 1:
                ARBFramebufferObject.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case 2:
                EXTFramebufferObject.glRenderbufferStorageEXT(target, internalFormat, width, height);
        }
    }
}
项目:CommunityEngine-Java    文件:Mesh.java   
public void add(float[] vertices, float[] texCoords, int[] indices) {
    indicesSize = indices.length;

    GL30.glBindVertexArray(vao);

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
    GL15.glBufferData(GL15.GL_ARRAY_BUFFER, Util.flip(vertices), GL15.GL_STATIC_DRAW);
    GL20.glVertexAttribPointer(0, 3, GL11.GL_FLOAT, false, 0, 0);
    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vboTexture);
    GL15.glBufferData(GL15.GL_ARRAY_BUFFER, Util.flip(texCoords), GL15.GL_STATIC_DRAW);
    GL20.glVertexAttribPointer(1, 2, GL11.GL_FLOAT, false, 0, 0);
    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);

    GL30.glBindVertexArray(0);

    GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, vboi);
    GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, Util.flip(indices), GL15.GL_STATIC_DRAW);
    GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0);
}
项目:BaseClient    文件:OpenGlHelper.java   
public static int glCheckFramebufferStatus(int target)
{
    if (!framebufferSupported)
    {
        return -1;
    }
    else
    {
        switch (framebufferType)
        {
            case 0:
                return GL30.glCheckFramebufferStatus(target);

            case 1:
                return ARBFramebufferObject.glCheckFramebufferStatus(target);

            case 2:
                return EXTFramebufferObject.glCheckFramebufferStatusEXT(target);

            default:
                return -1;
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;

            case 1:
                ARBFramebufferObject.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;

            case 2:
                EXTFramebufferObject.glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glBindFramebuffer(int target, int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glBindFramebuffer(target, framebufferIn);
                break;

            case 1:
                ARBFramebufferObject.glBindFramebuffer(target, framebufferIn);
                break;

            case 2:
                EXTFramebufferObject.glBindFramebufferEXT(target, framebufferIn);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glBindRenderbuffer(int target, int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glBindRenderbuffer(target, renderbuffer);
                break;

            case 1:
                ARBFramebufferObject.glBindRenderbuffer(target, renderbuffer);
                break;

            case 2:
                EXTFramebufferObject.glBindRenderbufferEXT(target, renderbuffer);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glDeleteFramebuffers(int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glDeleteFramebuffers(framebufferIn);
                break;

            case 1:
                ARBFramebufferObject.glDeleteFramebuffers(framebufferIn);
                break;

            case 2:
                EXTFramebufferObject.glDeleteFramebuffersEXT(framebufferIn);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
/**
 * Calls the appropriate glGenFramebuffers method and returns the newly created fbo, or returns -1 if not supported.
 */
public static int glGenFramebuffers()
{
    if (!framebufferSupported)
    {
        return -1;
    }
    else
    {
        switch (framebufferType)
        {
            case 0:
                return GL30.glGenFramebuffers();

            case 1:
                return ARBFramebufferObject.glGenFramebuffers();

            case 2:
                return EXTFramebufferObject.glGenFramebuffersEXT();

            default:
                return -1;
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glRenderbufferStorage(int target, int internalFormat, int width, int height)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case 1:
                ARBFramebufferObject.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case 2:
                EXTFramebufferObject.glRenderbufferStorageEXT(target, internalFormat, width, height);
        }
    }
}
项目:BaseClient    文件:OpenGlHelper.java   
public static void glFramebufferRenderbuffer(int target, int attachment, int renderBufferTarget, int renderBuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer);
                break;

            case 1:
                ARBFramebufferObject.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer);
                break;

            case 2:
                EXTFramebufferObject.glFramebufferRenderbufferEXT(target, attachment, renderBufferTarget, renderBuffer);
        }
    }
}