public void glBindTexture (int target, int texture) { GL11.glBindTexture(target, texture); }
public void glBindTexture (int target, int texture) { GL11.glBindTexture(target, texture); }
public void glBindTexture (int target, int texture) { GL11.glBindTexture(target, texture); }
public void glBindTexture (int target, int texture) { GL11.glBindTexture(target, texture); }
/** * Binds the normals attachment to the currently active texture unit. * Once a texture is bound it can be sampled by shaders. */ public void bindNormalsTexture() { GL11.glBindTexture(GL11.GL_TEXTURE_2D, normalsBufferTextureId); }
/** * Binds the light buffer attachment to the currently active texture unit. * Once a texture is bound it can be sampled by shaders. */ public void bindLightBufferTexture() { GL11.glBindTexture(GL11.GL_TEXTURE_2D, lightBufferTextureId); }
/** * Unbinds the texture attached to the currently active texture unit. * Quirk: this also works if the texture to be unbound is -not- an attachment * of the calling instance's FrameBuffer. */ public static void unbindTexture() { GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); }
/** * Binds the color attachment to the currently active texture unit. * Once a texture is bound it can be sampled by shaders. */ public void bindTexture() { GL11.glBindTexture(GL11.GL_TEXTURE_2D, colorBufferTextureId); }
/** * Binds the depth attachment to the currently active texture unit. * Once a texture is bound it can be sampled by shaders. */ public void bindDepthTexture() { GL11.glBindTexture(GL11.GL_TEXTURE_2D, depthStencilTextureId); }
@Override public void glBindTexture(final int target, final int texture) { GL11.glBindTexture(target, texture); }
public void glBindTexture(int param1, int param2) { GL11.glBindTexture(param1, param2); }
@Override public void process() { glActiveTexture(GL_TEXTURE0 + textureSlot); glBindTexture(textureType, textureId); material.setInt(materialParameter, textureSlot, true); } }
/** * Activates the texture unit GL_TEXTURE0 + textureSlot, binds the GL_TEXTURE_2D identified by textureId to it * and sets the material provided on construction to sample the texture via the parameterName also provided on * construction. */ @Override public void process() { glActiveTexture(GL_TEXTURE0 + textureSlot); glBindTexture(GL_TEXTURE_2D, textureId); material.setInt(shaderParameterName, textureSlot, true); } }
private static void createNormalsBuffer(FBO fbo, Dimensions dimensions) { fbo.normalsBufferTextureId = glGenTextures(); GL11.glBindTexture(GL11.GL_TEXTURE_2D, fbo.normalsBufferTextureId); setTextureParameters(GL11.GL_LINEAR); allocateTexture(dimensions, GL11.GL_RGBA, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL11.GL_TEXTURE_2D, fbo.normalsBufferTextureId, 0); }
@Override public void bindTexture(int slot, Texture texture) { if (activeMaterial != null && !activeMaterial.isDisposed()) { GL13.glActiveTexture(GL13.GL_TEXTURE0 + slot); // TODO: Need to be cubemap aware, only need to clear bind when switching from cubemap to 2D and vice versa, // TODO: Don't bind if already bound to the same GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture.getId()); GL13.glActiveTexture(GL13.GL_TEXTURE0); } }
private static void createLightBuffer(FBO fbo, Dimensions dimensions, Type type) { fbo.lightBufferTextureId = glGenTextures(); GL11.glBindTexture(GL11.GL_TEXTURE_2D, fbo.lightBufferTextureId); setTextureParameters(GL11.GL_LINEAR); if (type == Type.HDR) { allocateTexture(dimensions, ARBTextureFloat.GL_RGBA16F_ARB, GL11.GL_RGBA, ARBHalfFloatPixel.GL_HALF_FLOAT_ARB); } else { allocateTexture(dimensions, GL11.GL_RGBA, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE); } glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT2_EXT, GL11.GL_TEXTURE_2D, fbo.lightBufferTextureId, 0); }
private static void createColorBuffer(FBO fbo, Dimensions dimensions, Type type) { fbo.colorBufferTextureId = glGenTextures(); GL11.glBindTexture(GL11.GL_TEXTURE_2D, fbo.colorBufferTextureId); setTextureParameters(GL11.GL_LINEAR); if (type == Type.HDR) { allocateTexture(dimensions, GL11.GL_RGBA, GL11.GL_RGBA, ARBHalfFloatPixel.GL_HALF_FLOAT_ARB); } else { allocateTexture(dimensions, GL11.GL_RGBA, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE); } glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL11.GL_TEXTURE_2D, fbo.colorBufferTextureId, 0); }
public void beginRenderOverlay() { if (effectsTexture == null || !effectsTexture.isLoaded()) { return; } defaultTextured.activateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT); defaultTextured.enable(); glBindTexture(GL11.GL_TEXTURE_2D, effectsTexture.getId()); glEnable(GL11.GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); }
public void reloadTexture3D(int id, ByteBuffer alignedBuffer, Texture.WrapMode wrapMode, Texture.FilterMode filterMode, int size) { asynchToDisplayThread(() -> { glBindTexture(GL12.GL_TEXTURE_3D, id); glTexParameterf(GL12.GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, LwjglGraphicsUtil.getGLMode(wrapMode)); glTexParameterf(GL12.GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, LwjglGraphicsUtil.getGLMode(wrapMode)); glTexParameterf(GL12.GL_TEXTURE_3D, GL12.GL_TEXTURE_WRAP_R, LwjglGraphicsUtil.getGLMode(wrapMode)); GL11.glTexParameteri(GL12.GL_TEXTURE_3D, GL11.GL_TEXTURE_MIN_FILTER, LwjglGraphicsUtil.getGlMinFilter(filterMode)); GL11.glTexParameteri(GL12.GL_TEXTURE_3D, GL11.GL_TEXTURE_MAG_FILTER, LwjglGraphicsUtil.getGlMagFilter(filterMode)); GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 4); GL11.glTexParameteri(GL12.GL_TEXTURE_3D, GL12.GL_TEXTURE_MAX_LEVEL, 0); GL12.glTexImage3D(GL12.GL_TEXTURE_3D, 0, GL11.GL_RGBA, size, size, size, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, alignedBuffer); }); }
public void reloadTexture2D(int id, ByteBuffer[] buffers, Texture.WrapMode wrapMode, Texture.FilterMode filterMode, int width, int height) { asynchToDisplayThread(() -> { glBindTexture(GL11.GL_TEXTURE_2D, id); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, LwjglGraphicsUtil.getGLMode(wrapMode)); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, LwjglGraphicsUtil.getGLMode(wrapMode)); GL11.glTexParameteri(GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, LwjglGraphicsUtil.getGlMinFilter(filterMode)); GL11.glTexParameteri(GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, LwjglGraphicsUtil.getGlMagFilter(filterMode)); GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 4); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, buffers.length - 1); if (buffers.length > 0) { for (int i = 0; i < buffers.length; i++) { GL11.glTexImage2D(GL11.GL_TEXTURE_2D, i, GL11.GL_RGBA, width >> i, height >> i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffers[i]); } } else { GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer) null); } }); }