Framebuffer
Methods
bind
Bind this framebuffer, and every color buffer attached to it, and make it the render window's active framebuffer.
| Argument | Type | Required | Description |
|---|---|---|---|
modeArg | Number | No | The bind target (default: gl.FRAMEBUFFER). |
create
Create the underlying WebGL framebuffer at the given size. Does nothing until the OpenGL render window has been set.
| Argument | Type | Required | Description |
|---|---|---|---|
width | Number | Yes | |
height | Number | Yes |
extend
Method used to decorate a given object (publicAPI+model) with vtkFramebuffer characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IFramebufferInitialValues | No | (default: {}) |
getBothMode
Get the bind target that covers both reading and drawing, gl.FRAMEBUFFER.
getColorBuffers
Get a copy of the textures attached as color buffers, indexed by attachment.
getColorBuffersByReference
Get the textures attached as color buffers, indexed by attachment, without copying the array.
getGLFramebuffer
Get the underlying WebGL framebuffer, or null before create().
getSize
Get the width and height the framebuffer was created with, or null before create().
newInstance
Method used to create a new instance of vtkFramebuffer.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IFramebufferInitialValues | No | for pre-setting some of its content |
populateFramebuffer
Attach a color texture and a depth renderbuffer sized to the framebuffer, binding it first. Does nothing until the OpenGL render window has been set.
releaseGraphicsResources
Delete the underlying WebGL framebuffer, if one was created.
removeColorBuffer
Detach the texture bound to the given color attachment.
| Argument | Type | Required | Description |
|---|---|---|---|
attachment | Number | No | The color attachment index (default: 0). |
removeDepthBuffer
Detach the texture bound to the depth attachment.
restorePreviousBindings
Rebind the framebuffer that was bound when saveCurrentBindings ran, and restore it as the render window's active framebuffer. Does nothing until the OpenGL render window has been set.
| Argument | Type | Required | Description |
|---|---|---|---|
modeIn | Number | No | The bind target. |
restorePreviousBindingsAndBuffers
Restore the bindings and the buffers saved by saveCurrentBindingsAndBuffers.
| Argument | Type | Required | Description |
|---|---|---|---|
modeIn | Number | No | The bind target (default: gl.FRAMEBUFFER). |
restorePreviousBuffers
A no-op on WebGL, where draw and read buffers are not saved.
| Argument | Type | Required | Description |
|---|---|---|---|
modeIn | Number | No | The bind target. |
saveCurrentBindings
Remember the currently bound framebuffer and the render window's active framebuffer. Does nothing until the OpenGL render window has been set.
| Argument | Type | Required | Description |
|---|---|---|---|
modeIn | Number | No | The bind target. |
saveCurrentBindingsAndBuffers
Remember the currently bound framebuffer and the render window's active framebuffer, along with the draw and read buffers, so that restorePreviousBindingsAndBuffers can put them back.
| Argument | Type | Required | Description |
|---|---|---|---|
modeIn | Number | No | The bind target (default: gl.FRAMEBUFFER). |
saveCurrentBuffers
A no-op on WebGL, where draw and read buffers cannot be queried.
| Argument | Type | Required | Description |
|---|---|---|---|
modeIn | Number | No | The bind target. |
setColorBuffer
Attach a texture to the given color attachment. Does nothing until the OpenGL render window has been set.
| Argument | Type | Required | Description |
|---|---|---|---|
texture | vtkOpenGLTexture | Yes | The texture to attach. |
attachment | Number | No | The color attachment index (default: 0). |
setDepthBuffer
Attach a texture to the depth attachment. Does nothing until the OpenGL render window has been set.
| Argument | Type | Required | Description |
|---|---|---|---|
texture | vtkOpenGLTexture | Yes | The texture to attach. |
setOpenGLRenderWindow
Set the OpenGL render window this framebuffer belongs to, and take its WebGL context. Changing it releases the graphics resources held for the previous one.
| Argument | Type | Required | Description |
|---|---|---|---|
rw | vtkOpenGLRenderWindow | Yes | The OpenGL render window. |