Volume rendering quality property mode More...
#include <VolumeViz/nodes/SoVolumeRenderingQuality.h>
This property node causes subsequent SoVolumeRender nodes to be drawn with different rendering effects and/or levels of quality.
NOTE:
The pre-integrated mode (preIntegrated field) generally provides higher image quality for the same number of slices. Most applications should enable this field. However, note that pre-integration integrates between color map values. For typical scalar data containing sampled values, this provides a beneficial smoothing. It is especially useful when the color changes sharply between adjacent color map entries. However, when the color changes sharply between adjacent voxels, it can can cause values that are not actually in the original data to be displayed. This is undesireable for some data, for example "label" volumes resulting from segmentation. Pre-integration is not recommended for such data. Also note:
When lighting is enabled for volume rendering, VolumeViz applies the same lighting equation used for polygonal geometry, including (optionally) specular highlights. The base voxel color comes from the SoTransferFunction node or (optionally) from a custom shader function provided by the application. This color is modified using the current material (SoMaterial), a vector simulating a "normal vector" and one or more directional light nodes (SoDirectionalLight) found in the scene graph. Voxels can also cast and receive shadows (see SoShadowGroup).
Limitation: Pre-integrated and lighted rendering are not supported if using custom fragment shaders and redefining FRAGMENT_COMPUTE_COLOR slot.
VolumeViz supports two lighting modes using either the lighting field or the deferredLighting field. In both cases lighting is computed on the GPU as part of the rendering process. (Do NOT use the lighting field in the SoVolumeRendering node. This field enables a CPU lighting computation that is slow.)
Unlike other primitives (including other VolumeViz primitives), volume lighting is not affected by an SoLightModel node. Also unlike other primitives, if lighting is enabled and there are no light nodes in the scene graph, the voxel color is taken from the transfer function or custom shader function "as is" (other primitives would be black in this case).
Each light node's direction and intensity fields are used, but the color field is not currently used. The current SoMaterial specifies the ambient, specular, diffuse, and emissive color values for the lighting equation. Note that the default diffuse color is "light gray" (0.8), not full white. This allows specular lighting to push the color toward full white (as expected). If specular lighting is not desired, then changing this to full white (1.0) is recommended in order to see the true colors specified in the transfer function.
The following figures show the same volume data:
Default volume rendering | Pre-integrated volume rendering | Lighted pre-integrated volume rendering |
| | |
No Jittering | With Jittering |
| |
Gradient quality: When gradient lighting (lighting field) is enabled, the gradientQuality field allows you to choose between various gradient computation techniques. The computational cost increases with the quality. Has no effect on deferred lighting.
Low quality | Medium quality | High quality |
| | |
Surface scalar: When gradient lighting (lighting field) is enabled or edgeDetect2DMethod is GRADIENT, the surfaceScalarExponent field disables lighting (or edge detection) on uniform surfaces in order to avoid noise in these area. This field should not be mixed with unnormalizedGradientExponent. The default value is zero, but a small value, for example 2.0, is recommended. Has no effect on deferred lighting.
Surface Scalar disabled | Surface Scalar enabled |
| |
Unnormalized gradient : When gradient lighting (lighting field) is enabled, if unnormalizedGradientExponent is not 0, voxels with small gradients will get more contribution from the ambient light than voxels with high gradients. It is similar to surfaceScalarExponent but uses the ambient light instead of the transfer function color for uniform surfaces. Has no effect on deferred lighting.
Lighting model: When gradient lighting (lighting field) is enabled, the lightingModel field allows backward compatibility with the lighting model used in Open Inventor 6 or using the standard OpenGL lighting model. Setting this field to OPENGL is recommended. The following picture shows that in the case of OIV6, the volume is much brighter than the sphere. By setting the lighting model to OPENGL, the brightness of the volume matches the brightness of the sphere. Has no effect on deferred lighting.
OIV6 | OPENGL |
| |
Gradient threshold: When gradient lighting is enabled, gradients with a length less than gradientThreshold are ignored during the lighting computation. This avoids doing lighting on noise while still lighting important data. In the following screenshots, setting a threshold of 0.1 removed lighting on the noise surrounding the spheres. Has no effect on deferred lighting.
With gradientThreshold set to 0 | With gradientThreshold set to 0.1 |
| |
The following table shows the available edge detection techniques (explanation of faux shading is in SoTransferFunction):
No Edges | Boundary Opacity | Edge 2D |
| | |
Edge Coloring | Faux Shading (see SoTransferFunction) | |
| |
Because this node is derived from SoVolumeShader, IVVR_FIRST_RESERVED_TEXTURE_UNIT applies to it. See SoVolumeShader for more information.
lighting | FALSE |
preIntegrated | FALSE |
jittering | FALSE |
gradientThreshold | 0.0001 |
edgeColoring | FALSE |
edgeColor | (0, 0, 0) |
edgeThreshold | 0.2 |
boundaryOpacity | FALSE |
boundaryOpacityIntensity | 1.5 |
boundaryOpacityThreshold | 1.5 |
edgeDetect2D | FALSE |
edgeDetect2DInnerThreshold | 0.1 |
edgeDetect2DOuterThreshold | 0.1 |
edgeDetect2DMethod | LUMINANCE |
gradientQuality | MEDIUM |
lightingModel | OIV6 |
colorInterpolation | TRUE |
unnormalizedGradientExponent | 0 |
surfaceScalarExponent | 0 |
segmentedInterpolation | FALSE |
segmentedInterpolationThreshold | 0.5 |
voxelizedRendering | FALSE |
voxelOutline | FALSE |
voxelOutlineThreshold | 2. |
voxelOutlineWidth | 2. |
voxelOutlineColor | (0, 0, 0) |
ambientOcclusion | FALSE |
deferredLighting | FALSE |
interpolateOnMove | FALSE |
SoVolumeRender, SoVolumeShader, SoVolumeIsosurface, SoTransferFunction
MedicalDentalCurveUnfolding, MedicalDicomReader, MedicalGLVolumeRender, MedicalAmbientOcclusion, MedicalCutting, MedicalDeferredLighting, MedicalEdge2D, MedicalSimpleLightedVolume, Medical4DVolumeRendering, MedicalAnatomicalViews, MedicalDTIViewer, MedicalFreeHandCutting, MedicalMarchingCubesSurface, MedicalSegmentation, MedicalBonesMuscles, MedicalVolumePickingGpu, MedicalMultiTransferFunctions, BonesMuscles, AmbientOcclusion, DeferredLighting, Edge2D, GL_VolumeRender, MultiChannel_ex2, GpuDataCompose, SegmentedInterpolation, SimpleClippingGroup, SimpleGridClipping, SimpleInteractiveParameters, SimpleLightedVolume, SurfaceScalar, VolRend
The edge detection algorithm used when edgeDetect2D is TRUE, can work on the image luminance, depth buffer and/or gradient.
These enums can be combined in the field edgeDetect2DMethod.
LUMINANCE |
Edge detection will use the image's luminance. This method has a very little impact on speed. |
DEPTH |
Edge detection will use the image's depth buffer. |
GRADIENT |
Edge detection will use the volume's gradient. These gradients are affected by the surfaceScalarExponent fied. This method is the most computationally expensive. |
Gradient Quality mode.
Available Lighting Model mode.
OIV6 |
Use Open Inventor 6 lighting model for volume and isosurface lighting. |
OPENGL |
Use the equation specified by OpenGL to do volume and isosurface lighting. This model should be preferred because it responds to SoMaterial in the usual Open Inventor way. |
SoVolumeRenderingQuality::SoVolumeRenderingQuality | ( | ) |
Constructor.
static SoType SoVolumeRenderingQuality::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoVolumeShader.
virtual SoType SoVolumeRenderingQuality::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoVolumeShader.
If true, apply an ambient occlusion effect (default is FALSE).
Ambient occlusion is an shading effect that approximates attenuation of light due to neighboring voxels. It works best when the volume data contains surfaces (region boundaries with relatively sharp gradients), or in voxelized rendering mode, and those voxels are opaque.
If you use ambientOcclusion, you should set the SoVolumeRender::samplingAlignment field to BOUNDARY_ALIGNED to reduce "slicing" artifacts.
NOTE: Only available in raycasting mode. NOTE: field available since Open Inventor 9.1
Enable boundary opacity.
If TRUE, increases boundary opacity based on the gradient magnitude. Default is FALSE.
This effect has a significant performance penalty.
SoVolumeRender::subdivideTile will be disabled if set to TRUE.
NOTE: field available since Open Inventor 7.0
Applies when boundaryOpacity is TRUE.
If > 1, this increases the boundary opacity globally. If < 1, decreases it. Default is 1.5.
NOTE: field available since Open Inventor 7.0
Applies when boundaryOpacity is TRUE.
If this value is low (near 0), only regions with a high gradient will be enhanced. Default is 1.5.
NOTE: field available since Open Inventor 7.0
Controls interpolation of data values used for color lookup.
If FALSE, interpolation is not done on data values used to access the colormap but is still done when computing gradient for lighting. This may be used to render a segmented dataset where interpolation is not appropriate. Default is TRUE. Only affects gradient based lighting (lighting field).
Generally it's better to set the SoVolumeRender::interpolation field to NEAREST, unless you really want to use gradient based lighting.
NOTE: field available since Open Inventor 7.2SoDEPRECATED SoSFBool SoVolumeRenderingQuality::cubicInterpolation |
Enable cubic interpolation of data values.
Enable screen space lighting (computed on the GPU).
Default is FALSE. Deferred lighting is computed based on the final image depth buffer instead using the data gradients. It is much faster than gradient based lighting (see the lighting field) and supports multiple light sources (up to 8). Because it is not based on data gradients, it does not have problems with small/random gradients and it gives a much better result when using clipping nodes like SoVolumeClippingGroup or SoUniformGridClipping. Light sources are defined by Open Inventor SoDirectionalLight nodes.
Notes:
LIMITATIONS
Color used to draw edges when edgeColoring or edgeDetect2D is TRUE.
Default is black (0,0,0).
NOTE: field available since Open Inventor 7.0
Enable edge coloring.
If TRUE, changes the color based on the gradient direction (normal). Edges will be highlighted with the color specified in edgeColor. Areas where the normal (computed from the gradient) is facing the camera will have an unmodified color, whereas areas where the normal is more perpendicular to the view direction will tend towards edgeColor. Default is FALSE.
NOTE: field available since Open Inventor 7.0
Enable 2D edge detection.
If this field is TRUE, a 2D edge detection algorithm is used to highlight edges in the rendered image of the volume. Default is FALSE.
NOTE: field available since Open Inventor 7.0
Increase this value to decrease noise on silhouette edges.
1 = remove all edges, 0 = remove nothing. Default is 0.1
NOTE: field available since Open Inventor 7.0
Method used for 2D edge detection.
Specifies the edge detection algorithm used when edgeDetect2D is TRUE. Edge detection can work on the image luminance, depth buffer and/or gradient. For example, gradients may be too noisy to give interesting edges and may be ignored with this field. The gradient method is also the slowest (luminance being the fastest) because it needs more texture fetchs. See EdgeDetect2DMethod. Default is LUMINANCE and GRADIENT.
NOTE: field available since Open Inventor 8.1
Increase this value to decrease noise on edges in the volume.
1 = remove all edges, 0 = remove nothing. Default is 0.1
NOTE: field available since Open Inventor 7.0
If this value is low, more edges will be detected.
Default is 0.2. Min value is 0. There is no max, but most of the time a value between 0 and 1 is good.
NOTE: field available since Open Inventor 7.0
Specifies the algorithm used to compute gradients, for example, normals for lighting.
Only affects gradient based lighting (lighting field).
Use enum GradientQuality. Default is MEDIUM.
NOTE: field available since Open Inventor 7.0
Ignore all gradients with a magnitude less than the specified threshold.
Default is 0.0001, meaning that all gradients are used in the lighting computation. Maximum useful value is 1.0, because gradient vectors are normalized. Only affects gradient based lighting (lighting field).
NOTE: field available since Open Inventor 7.0
Enable jittering.
If set to TRUE, a random offset is added to texture coordinates in order to decrease ringing artifacts (boundary edge artifacts) without the cost of drawing a higher number of slices. Note that this creates a "noisy" image. Instead we recommend setting the SoVolumeRender::samplingAlignment field to BOUNDARY_ALIGNED. Note: Jittering is only available when pre-integrated rendering is enabled. Default is FALSE.
NOTE: field available since Open Inventor 7.0
Enable gradient based lighting (computed on the GPU).
Default is FALSE. Gradient based lighting is computed using the direction and magnitude of gradient vectors computed from the data values in place of "normal vectors" in the lighting equation. A gradient vector is computed for each sample point along the rays cast through the volume.
VolumeViz also supports screen space lighting (see the deferredLighting field).
Notes:
LIMITATIONS
Sets the lighting model.
For backward compatibility with Open Inventor v6. Applications should set this field to OPENGL. Only affects gradient based lighting (lighting field).
Use enum LightingModel. Default is OIV6.
NOTE: field available since Open Inventor 7.0
Enable pre-integrated volume rendering.
Pre-integrated rendering can significantly increase image quality (at the cost of slightly lower performance). Default is FALSE.
Limitations:
Allow correct interpolation when rendering segmented data.
NOTE: Only available on SoVolumeIsosurface.
NOTE: field available since Open Inventor 8.5
Defines the iso distance used when segmentedInterpolation is true.
Default is 0.5. value must be in the range [0 .. 1] NOTE: Only available on SoVolumeIsosurface.
NOTE: field available since Open Inventor 8.6
If this field is greater than or equal to 1, a surface with a small gradient will be less lighted than a surface with a high gradient.
The resulting color is a mix between the lighted voxel color and the non-lighted voxel color (ie: the corresponding entry in the colormap). If the value is less than 1, the field is ignored. Values higher than 256 will apply lighting on almost all surfaces. For most datasets, values between 2 and 16 should be enough. Default is 0.
Only affects gradient based lighting (lighting field). NOTE: field available since Open Inventor 8.1
When unnormalizedGradientExponent is not 0, surfaces with high gradients will be more lighted than surfaces with small gradients.
Voxels with small gradients will have less diffuse and specular than other with high gradients (ie: ambient color will be the biggest contributor). This lighting contribution can be controlled with this field. If this value is high, smaller gradients will contribute to lighting. Values higher than 256 will apply lighting on almost all surfaces. For most dataset, values between 2 and 16 should be enough. Default is 0.
Only affects gradient based lighting (lighting field). NOTE: field available since Open Inventor 8.1
If true, SoVolumeRender displays voxels as individual cubes.
Default is false.
Setting true will force using the raycasting render mode (see SoVolumeShader::raycasting) for volume rendering (but that is the default mode anyway).
NOTE: field available since Open Inventor 9.0If true, draw the outline of voxels (default is false).
Notes:
When voxelOutline is TRUE, this value specifies the voxel outline color.
Default is black : (0, 0, 0).
NOTE: field available since Open Inventor 9.6When voxelOutline is TRUE, this threshold specifies the minimum size of a voxel, in screen pixels, for the voxel outline to be visible.
Default is 2, meaning that outline is visible only if a single voxel is bigger than 2 screen pixels.
NOTE: field available since Open Inventor 9.2When voxelOutline is TRUE, this value specifies the voxel outline width in pixels.
Default is 2 pixels.
NOTE: field available since Open Inventor 9.6