VTK/ProgrammableMultiVolumeRendering: Difference between revisions

From KitwarePublic
< VTK
Jump to navigationJump to search
(Created page with "! Page under construction ! The goal of this page is to document the shader replacement functionality available in vtkGPUVolumeRaycastMapper starting with version (9?) of VTK.")
 
No edit summary
Line 2: Line 2:


The goal of this page is to document the shader replacement functionality available in vtkGPUVolumeRaycastMapper starting with version (9?) of VTK.
The goal of this page is to document the shader replacement functionality available in vtkGPUVolumeRaycastMapper starting with version (9?) of VTK.
= Global variables =
Variables prefixed with "g_"
{| class="wikitable"
!Name
!Type
!Space
!Description
|-
|g_dataPos ||vec3 ||Normalized volume ||Current ray integration position in texture space (first volume?), recomputed at every iteration along the ray
|-
|g_fragColor ||vec4 ||None ||Variable where color is accumulated along the ray
|-
|g_srcColor ||vec4 ||None ||Result of the color computation at g_dataPos (current position).
|-
|g_exit ||bool || None ||Terminate ray integration.
|-
|g_skip ||bool || None ||Skip computation of current iteration step if true
|}
= Interpolated variables =
Variables prefixed with "ip_". These variables contains values computed in the vertex shader stage and interpolated for each fragment.
{| class="wikitable"
!Name
!Type
!Space
!Description
|-
|ip_textureCoords ||vec3 || Normalized volume ||Interpolated texture coord
|-
|ip_vertexPos ||vec3 || ? || Interpolated vertex position at current fragment
|}
= Uniform variables =
Variables prefixed with "in_". The value of these variables is set from the c++ code by the mapper. It is now possible for users to define custom uniform variables by using the class vtkOpenGLUniforms. The vtkOpenGLGPURaycastMapper class contains one instance of this class for each type of shader. The objects can be accessed with vtkOpenGLGPURaycastMapper::GetFragmentCustomUniforms and vtkOpenGLGPURaycastMapper::GetVertexCustomUniforms functions. They allow to define uniform variable of any GLSL type and set their values at any moment. These variables can then be used in custom shader code.
{| class="wikitable"
!Name
!Type
!Space
!Description
|-
|in_volume ||sampler3D[n] || None || One sampler for each of the input volumes (n). Allows to sample the 3D texture that contains the volume
|-
|in_volume_scale ||vec4[n] || None || Scale to apply to the sampled scalar value of each input volume
|-
|in_volume_bias ||vec4[n] || None || Offset to apply to the sampled scalar value of each input volume
|}

Revision as of 13:36, 5 October 2018

! Page under construction !

The goal of this page is to document the shader replacement functionality available in vtkGPUVolumeRaycastMapper starting with version (9?) of VTK.


Global variables

Variables prefixed with "g_"

Name Type Space Description
g_dataPos vec3 Normalized volume Current ray integration position in texture space (first volume?), recomputed at every iteration along the ray
g_fragColor vec4 None Variable where color is accumulated along the ray
g_srcColor vec4 None Result of the color computation at g_dataPos (current position).
g_exit bool None Terminate ray integration.
g_skip bool None Skip computation of current iteration step if true

Interpolated variables

Variables prefixed with "ip_". These variables contains values computed in the vertex shader stage and interpolated for each fragment.

Name Type Space Description
ip_textureCoords vec3 Normalized volume Interpolated texture coord
ip_vertexPos vec3 ? Interpolated vertex position at current fragment

Uniform variables

Variables prefixed with "in_". The value of these variables is set from the c++ code by the mapper. It is now possible for users to define custom uniform variables by using the class vtkOpenGLUniforms. The vtkOpenGLGPURaycastMapper class contains one instance of this class for each type of shader. The objects can be accessed with vtkOpenGLGPURaycastMapper::GetFragmentCustomUniforms and vtkOpenGLGPURaycastMapper::GetVertexCustomUniforms functions. They allow to define uniform variable of any GLSL type and set their values at any moment. These variables can then be used in custom shader code.

Name Type Space Description
in_volume sampler3D[n] None One sampler for each of the input volumes (n). Allows to sample the 3D texture that contains the volume
in_volume_scale vec4[n] None Scale to apply to the sampled scalar value of each input volume
in_volume_bias vec4[n] None Offset to apply to the sampled scalar value of each input volume