TODO - framebuffer handling has been broken out into a separate class, but documentation is not yet up to date. For now, please refer directly to src/webgl/frame-buffer.js
Creates or binds/unbinds a framebuffer. You can also use this method to
bind the framebuffer to a texture and renderbuffers. If the
framebuffer already exists then calling setFrameBuffer with
true or false as options will bind/unbind the framebuffer.
Also, for all properties set to a buffer, these properties are
remembered so they’re optional for later calls.
program.setFrameBuffer(name[, options]);
setTexture.{ attachment: gl.COLOR_ATTACHMENT0 }.width and height of the renderbuffer are the same as the ones specified above.{ attachment: gl.DEPTH_ATTACHMENT }.Using a frambuffer to render a scene into a texture. Taken from [lesson 16]http://uber.github.io/luma.gl/examples/lessons/16/).
//create framebuffer
program.setFrameBuffer('monitor', {
width: screenWidth,
height: screenHeight,
bindToTexture: {
parameters: [{
name: 'TEXTURE_MAG_FILTER',
value: 'LINEAR'
}, {
name: 'TEXTURE_MIN_FILTER',
value: 'LINEAR_MIPMAP_NEAREST',
generateMipmap: false
}]
},
bindToRenderBuffer: true
});For each key, value of the object passed in it executes
setFrameBuffer(key, value).
program.setFrameBuffers(object);
Creates or binds/unbinds a renderbuffer. If the renderbuffer already exists and the second parameter is a boolean it’ll bind or unbind the renderbuffer.
Also, for all properties set to a buffer, these properties are remembered so they’re optional for later calls.
program.setRenderBuffer(name[, options]);
gl.DEPTH_COMPONENT16.For each key, value of the object passed in it executes setRenderBuffer(key, value).
program.setRenderBuffers(object);