VolumeMapper
Methods
applyShaderReplacements
Apply the shader replacements a renderable declares under its OpenGL view specific properties.
| Argument | Type | Required | Description |
|---|---|---|---|
shaders | IShaderSources | Yes | The shader sources, edited in place. |
viewSpec | Yes | The OpenGL view specific properties of the renderable. | |
pre | Boolean | No | Apply 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.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The 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.
| Argument | Type | Required | Description |
|---|---|---|---|
shaders | IShaderSources | Yes | The shader sources, edited in place. |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
extend
Method used to decorate a given object (publicAPI+model) with vtkOpenGLVolumeMapper 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 | IOpenGLVolumeMapperInitialValues | No | (default: {}) |
getClippingPlaneShaderParameters
Set the clipping plane uniforms of the shader program.
| Argument | Type | Required | Description |
|---|---|---|---|
cellBO | Yes | The OpenGL helper carrying the shader program. | |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The 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.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer. |
getNeedToRebuildBufferObjects
Whether the textures and the vertex buffer are out of date.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
getNeedToRebuildShaders
Whether the shader program has to be rebuilt for the given helper.
| Argument | Type | Required | Description |
|---|---|---|---|
cellBO | Yes | The OpenGL helper carrying the shader program. | |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The 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.
| Argument | Type | Required | Description |
|---|---|---|---|
shaders | IShaderSources | Yes | The shader sources, edited in place. |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
getShaderTemplate
Fill in the shader sources with the default volume shader template.
| Argument | Type | Required | Description |
|---|---|---|---|
shaders | IShaderSources | Yes | The shader sources, edited in place. |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
newInstance
Method used to create a new instance of vtkOpenGLVolumeMapper.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IOpenGLVolumeMapperInitialValues | No | for 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.
| Argument | Type | Required | Description |
|---|---|---|---|
prepass | Boolean | Yes | Whether the traversal is on its way down. |
renderPass | vtkForwardPass | Yes | The 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.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
renderPieceDraw
Activate the textures, update the shaders and draw the box the volume is ray cast through.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
renderPieceFinish
Blit the reduced-resolution offscreen result back onto the render target and update the frame timing that drives the resolution.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The 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.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
replaceShaderValues
Substitute the mapper's own declarations and implementation into the shader sources.
| Argument | Type | Required | Description |
|---|---|---|---|
shaders | IShaderSources | Yes | The shader sources, edited in place. |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
setCameraShaderParameters
Set the camera uniforms of the shader program.
| Argument | Type | Required | Description |
|---|---|---|---|
cellBO | Yes | The OpenGL helper carrying the shader program. | |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
setContext
Set the WebGL context this mapper renders with.
| Argument | Type | Required | Description |
|---|---|---|---|
context | Yes | The WebGL context. |
setMapperShaderParameters
Set the texture and geometry uniforms of the shader program.
| Argument | Type | Required | Description |
|---|---|---|---|
cellBO | Yes | The OpenGL helper carrying the shader program. | |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
setPropertyShaderParameters
Set the volume property uniforms of the shader program, including the transfer function ranges and the lighting.
| Argument | Type | Required | Description |
|---|---|---|---|
cellBO | Yes | The OpenGL helper carrying the shader program. | |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
updateBufferObjects
Rebuild the buffer objects when they are out of date.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
updateShaders
Make the helper's shader program current, rebuilding it when needed, and push the mapper, camera and property uniforms.
| Argument | Type | Required | Description |
|---|---|---|---|
cellBO | Yes | The OpenGL helper carrying the shader program. | |
ren | vtkRenderer | Yes | The renderer. |
actor | vtkVolume | Yes | The volume being rendered. |
volumePass
Resolve the ancestors this mapper renders with and render the volume.
| Argument | Type | Required | Description |
|---|---|---|---|
prepass | Boolean | Yes | Whether the traversal is on its way down. |
renderPass | vtkRenderPass | Yes | The render pass being traversed. |
zBufferPass
Capture the z-buffer texture of the pass, so that the volume can be mixed with the opaque geometry.
| Argument | Type | Required | Description |
|---|---|---|---|
prepass | Boolean | Yes | Whether the traversal is on its way down. |
renderPass | vtkForwardPass | Yes | The pass holding the z-buffer texture. |