Skip to content

VolumeMapper ​

Methods ​

applyShaderReplacements ​

Apply the shader replacements a renderable declares under its OpenGL view specific properties.

ArgumentTypeRequiredDescription
shadersIShaderSourcesYesThe shader sources, edited in place.
viewSpecYesThe OpenGL view specific properties of the renderable.
preBooleanNoApply the replacements marked replaceFirst.

buildBufferObjects ​

Build the scalar, color, opacity and label outline textures, and the vertex buffer of the box the volume is ray cast through.

ArgumentTypeRequiredDescription
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

buildPass ​

Drop the z-buffer texture captured by a previous traversal.

buildShaders ​

Assemble the shader sources, applying the user replacements and the mapper's own substitutions.

ArgumentTypeRequiredDescription
shadersIShaderSourcesYesThe shader sources, edited in place.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

extend ​

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

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIOpenGLVolumeMapperInitialValuesNo(default: {})

getClippingPlaneShaderParameters ​

Set the clipping plane uniforms of the shader program.

ArgumentTypeRequiredDescription
cellBOYesThe OpenGL helper carrying the shader program.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

getContext ​

Get the WebGL context this mapper renders with.

getCurrentSampleDistance ​

Get the sample distance to ray cast with, which is the renderable's sample distance scaled by its interaction factor while the interactor animates.

ArgumentTypeRequiredDescription
renvtkRendererYesThe renderer.

getNeedToRebuildBufferObjects ​

Whether the textures and the vertex buffer are out of date.

ArgumentTypeRequiredDescription
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

getNeedToRebuildShaders ​

Whether the shader program has to be rebuilt for the given helper.

ArgumentTypeRequiredDescription
cellBOYesThe OpenGL helper carrying the shader program.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

getRenderTargetOffset ​

Get the lower left corner of the viewport this mapper renders into.

getRenderTargetSize ​

Get the width and height of the target this mapper renders into, which is the reduced offscreen size while the volume is rendered at a lower resolution.

getReplacedShaderTemplate ​

Fill in the shader template, letting the renderable's OpenGL view specific properties override any of the three shader sources.

ArgumentTypeRequiredDescription
shadersIShaderSourcesYesThe shader sources, edited in place.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

getShaderTemplate ​

Fill in the shader sources with the default volume shader template.

ArgumentTypeRequiredDescription
shadersIShaderSourcesYesThe shader sources, edited in place.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

newInstance ​

Method used to create a new instance of vtkOpenGLVolumeMapper.

ArgumentTypeRequiredDescription
initialValuesIOpenGLVolumeMapperInitialValuesNofor pre-setting some of its content

opaqueZBufferPass ​

Capture the z-buffer texture of the pass, so that the volume can be mixed with the opaque geometry.

ArgumentTypeRequiredDescription
prepassBooleanYesWhether the traversal is on its way down.
renderPassvtkForwardPassYesThe pass holding the z-buffer texture.

releaseGraphicsResources ​

Release the framebuffers, textures and vertex buffers of this mapper.

renderPiece ​

Render the volume for the given renderer and actor.

ArgumentTypeRequiredDescription
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

renderPieceDraw ​

Activate the textures, update the shaders and draw the box the volume is ray cast through.

ArgumentTypeRequiredDescription
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

renderPieceFinish ​

Blit the reduced-resolution offscreen result back onto the render target and update the frame timing that drives the resolution.

ArgumentTypeRequiredDescription
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

renderPieceStart ​

Pick the render resolution from the recent frame times, bind the offscreen framebuffer when one is needed, and bring the buffer objects up to date.

ArgumentTypeRequiredDescription
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

replaceShaderValues ​

Substitute the mapper's own declarations and implementation into the shader sources.

ArgumentTypeRequiredDescription
shadersIShaderSourcesYesThe shader sources, edited in place.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

setCameraShaderParameters ​

Set the camera uniforms of the shader program.

ArgumentTypeRequiredDescription
cellBOYesThe OpenGL helper carrying the shader program.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

setContext ​

Set the WebGL context this mapper renders with.

ArgumentTypeRequiredDescription
contextYesThe WebGL context.

setMapperShaderParameters ​

Set the texture and geometry uniforms of the shader program.

ArgumentTypeRequiredDescription
cellBOYesThe OpenGL helper carrying the shader program.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

setPropertyShaderParameters ​

Set the volume property uniforms of the shader program, including the transfer function ranges and the lighting.

ArgumentTypeRequiredDescription
cellBOYesThe OpenGL helper carrying the shader program.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

updateBufferObjects ​

Rebuild the buffer objects when they are out of date.

ArgumentTypeRequiredDescription
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

updateShaders ​

Make the helper's shader program current, rebuilding it when needed, and push the mapper, camera and property uniforms.

ArgumentTypeRequiredDescription
cellBOYesThe OpenGL helper carrying the shader program.
renvtkRendererYesThe renderer.
actorvtkVolumeYesThe volume being rendered.

volumePass ​

Resolve the ancestors this mapper renders with and render the volume.

ArgumentTypeRequiredDescription
prepassBooleanYesWhether the traversal is on its way down.
renderPassvtkRenderPassYesThe render pass being traversed.

zBufferPass ​

Capture the z-buffer texture of the pass, so that the volume can be mixed with the opaque geometry.

ArgumentTypeRequiredDescription
prepassBooleanYesWhether the traversal is on its way down.
renderPassvtkForwardPassYesThe pass holding the z-buffer texture.