Skip to content

Framebuffer ​

Methods ​

bind ​

Bind this framebuffer, and every color buffer attached to it, and make it the render window's active framebuffer.

ArgumentTypeRequiredDescription
modeArgNumberNoThe 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.

ArgumentTypeRequiredDescription
widthNumberYes
heightNumberYes

extend ​

Method used to decorate a given object (publicAPI+model) with vtkFramebuffer characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIFramebufferInitialValuesNo(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.

ArgumentTypeRequiredDescription
initialValuesIFramebufferInitialValuesNofor 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.

ArgumentTypeRequiredDescription
attachmentNumberNoThe 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.

ArgumentTypeRequiredDescription
modeInNumberNoThe bind target.

restorePreviousBindingsAndBuffers ​

Restore the bindings and the buffers saved by saveCurrentBindingsAndBuffers.

ArgumentTypeRequiredDescription
modeInNumberNoThe bind target (default: gl.FRAMEBUFFER).

restorePreviousBuffers ​

A no-op on WebGL, where draw and read buffers are not saved.

ArgumentTypeRequiredDescription
modeInNumberNoThe 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.

ArgumentTypeRequiredDescription
modeInNumberNoThe 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.

ArgumentTypeRequiredDescription
modeInNumberNoThe bind target (default: gl.FRAMEBUFFER).

saveCurrentBuffers ​

A no-op on WebGL, where draw and read buffers cannot be queried.

ArgumentTypeRequiredDescription
modeInNumberNoThe bind target.

setColorBuffer ​

Attach a texture to the given color attachment. Does nothing until the OpenGL render window has been set.

ArgumentTypeRequiredDescription
texturevtkOpenGLTextureYesThe texture to attach.
attachmentNumberNoThe color attachment index (default: 0).

setDepthBuffer ​

Attach a texture to the depth attachment. Does nothing until the OpenGL render window has been set.

ArgumentTypeRequiredDescription
texturevtkOpenGLTextureYesThe 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.

ArgumentTypeRequiredDescription
rwvtkOpenGLRenderWindowYesThe OpenGL render window.