Constructor
new L3D.GLFramebuffer(gl, colorTextures, depthTexture, stencil)
Creates a new frame buffer object.
gl |
GLContext | The GLContext to create the framebuffer with. |
colorTextures |
* | |
depthTexture |
* | |
stencil |
bool |
Properties
The GLFramebuffer currently bound to the active GLContext
The first bound color texture, which is usually the primary one.
Methods
bind()
Make the framebuffer active so all rendering will render to it.
blit(colorIndex, targetTexture, shader, uniforms)
Draw the framebuffer color texture to the screen (or current framebuffer)
colorIndex |
int | The color texture to draw, 0 by default |
targetTexture |
GLTexture | Optional texture to draw to, otherwise it will draw to the screen or active framebuffer. |
shader |
GLShader | Optional shader to use. |
uniforms |
Object | Optional uniforms for the shader. |
destroy()
Free up GL memory used by the framebuffer.
setTextures(colorTextures, depthTexture, skipDisable)
Bind color and depth textures to the framebuffer.
colorTextures |
* | |
depthTexture |
GLTexture | |
skipDisable |
bool | If true, the framebuffer won't be unbound after initialization, allowing it to continue to be used without having to rebind it. |
unbind()
Unbind the framebuffer, switching back to the previous active framebuffer.
update(skipDisable)
Updates the framebuffer with the textures and buffers.
skipDisable |
bool | If true, the framebuffer won't be unbound after updating, allowing it to continue to be used without having to rebind it. |