public class SoVolumeRenderingQuality extends SoVolumeShader
SoVolumeRender
nodes to be drawn with different rendering effects and/or levels of quality.
NOTE:
SoVolumeShader
or SoVolumeRenderingQuality
. However since Open Inventor 7.1, both SoVolumeRenderingQuality
and SoVolumeIsosurface
may applied to the same SoVolumeRender
node.
SoVolumeShader
or SoVolumeRenderingQuality
. However if the application needs the advanced rendering features of SoVolumeRenderingQuality
, e.g. lighting, in addition to the customized behavior, then you should use this node (which is derived from SoVolumeShader
). Using the shader rendering framework is explained on the SoVolumeShader
page.
SoVolumeRenderingQuality
node must be before the SoVolumeRender
and after the SoTransferFunction
.
SoSeparator
nodes).
Various enhanced rendering modes for volume rendering are available:
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:
preIntegrated
field has no effect on SoVolumeIsosurface
rendering.
preIntegrated
field is only considered when SoVolumeRendering.renderMode is set to VOLUME_RENDERING (the default).
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.)
lighting
field enables gradient based lighting, where the "normal vector" at each sample along the ray is a gradient vector computed from the data values in the volume. Gradient based lighting only supports a single light source and only the first light in the scene graph (typically the viewer's "headlight") is used. No other lights affect the volume in this case. The gradientQuality
field controls the algorithm used to compute gradient vectors. Several other fields affect the gradient computation including gradientThreshold
, surfaceScalarExponent
and unnormalizedGradientExponent
. Setting surfaceScalarExponent to a small value, for example 2.0, is recommended. deferredLighting
field enables screen space lighting, where the "normal vector" is computed from the final image depth buffer. Deferred lighting is faster and supports multiple light sources, but works best when the transfer function makes each data value either opaque or transparent. Deferred lighting is not affected by gradient related fields.
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:
<TABLE border=1 cellspacing=0 cellpadding=5> <TR><TD valign=_top> Default volume rendering <TD valign=_top> Pre-integrated volume rendering <TD valign=_top> Lighted pre-integrated volume rendering <TR><TD valign=_top> @image html quality_volume.jpg <TD valign=_top> @image html quality_preintegrated.jpg <TD valign=_top> @image html quality_light.jpg </TABLE>
Jittering: When jittering
is set to true, a random offset is added to texture coordinates in order to decrease "ring" 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.
<TABLE border=1 cellspacing=0 cellpadding=5> <TR><TD valign=_top> No Jittering <TD valign=_top> With Jittering <TR><TD valign=_top> @image html volume_nojitter.jpg <TD valign=_top> @image html volume_jitter.jpg </TABLE>
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.
<TABLE border=1 cellspacing=0 cellpadding=5> <TR><TD valign=_top> Low quality <TD valign=_top> Medium quality <TD valign=_top> High quality <TR><TD valign=_top> @image html volume_forwarddiff.jpg <TD valign=_top> @image html volume_centraldiff.jpg <TD valign=_top> @image html volume_sobel.jpg </TABLE>
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.
<TABLE border=1 cellspacing=0 cellpadding=5> <TR><TD valign=_top> Surface Scalar disabled <TD valign=_top> Surface Scalar enabled <TR><TD valign=_top> @image html surfaceScalarOff.jpg <TD valign=_top> @image html surfaceScalarOn.jpg </TABLE>
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.
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.
<TABLE border=1 cellspacing=0 cellpadding=5> <TR><TD valign=_top> With #gradientThreshold set to 0 <TD valign=_top> With #gradientThreshold set to 0.1 <TR><TD valign=_top> @image html volume_gradientThr0.jpg <TD valign=_top> @image html volume_gradientThr1.jpg </TABLE>
Various image enhancement techniques are available in this node and in SoTransferFunction
.
ambientOcclusion
field enables a rendering technique that simulates self-shadowing of the volume. In other words, the amount of ambient (global) light in the scene reaching each sample is reduced by neighboring voxels. This effect makes it much easier to see the relative depth of features in the volume. Generally we recommend using this effect rather than the following effects. SoVolumeRender.samplingAlignment
field to BOUNDARY_ALIGNED to reduce "slicing" artifacts. boundaryOpacity
increases opacity depending on the length of the gradient vector. Areas with large gradient changes will have their opacity increased according to the boundaryOpacityIntensity
. Note that this option has a significant performance penalty. edgeColoring
is on, the color of each voxel may be mixed with the 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
. edgeDetect2D
is enabled, an image space filter is applied on the volume rendering image in order to detect edges, which will be highlighted. The results are affected by the edgeDetect2DInnerThreshold
and edgeDetect2DOuterThreshold
fields. The edgeDetect2DMethod
bitmask allows to apply the edge detection on the image's luminance, depth and/or gradient. The gradient method may give noisy result, the surfaceScalarExponent
may help to improve the result in this case. The gradient method has a significant performance penalty. 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.
Volume projection (SoProjection
or derived classes) is incompatible with some options enabled by this node.
Do not enable the preIntegrated, jittering or edgeDetect2D fields when using projection.
File format/default:
VolumeRenderingQuality {
lighting | false |
preIntegrated | true |
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 |
colorInterpolation | true |
unnormalizedGradientExponent | 0 |
surfaceScalarExponent | 5 |
segmentedInterpolation | false |
segmentedInterpolationThreshold | 0.5 |
voxelizedRendering | false |
voxelOutline | false |
voxelOutlineThreshold | 2. |
voxelOutlineWidth | 2. |
voxelOutlineColor | (0, 0, 0) |
ambientOcclusion | false |
deferredLighting | true |
interpolateOnMove | true |
Action behavior:
SoGLRenderAction
Sets volume rendering quality parameters in the traversal state.
See also:
SoVolumeRender
, SoVolumeShader
, SoVolumeIsosurface
, SoTransferFunction
Modifier and Type | Class and Description |
---|---|
static class |
SoVolumeRenderingQuality.EdgeDetect2DMethods
The edge detection algorithm used when
edgeDetect2D is true, can work on the image luminance, depth buffer and/or gradient. |
static class |
SoVolumeRenderingQuality.GradientQualities
Gradient Quality mode.
|
static class |
SoVolumeRenderingQuality.LightingModels
Deprecated.
|
SoVolumeShader.ShaderPositions
SoShaderProgram.GeometryInputTypes, SoShaderProgram.GeometryOutputTypes
SoNode.RenderModes
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFBool |
ambientOcclusion
If true, apply an ambient occlusion effect (default is false).
|
SoSFBool |
boundaryOpacity
Enable boundary opacity.
|
SoSFFloat |
boundaryOpacityIntensity
Applies when
boundaryOpacity is true. |
SoSFFloat |
boundaryOpacityThreshold
Applies when
boundaryOpacity is true. |
SoSFBool |
colorInterpolation
Controls interpolation of data values used for color lookup.
|
SoSFBool |
cubicInterpolation
Deprecated.
As of Open Inventor 9300 Use SoVolumeShape.interpolation field instead.
|
SoSFBool |
deferredLighting
Enable screen space lighting (computed on the GPU).
|
SoSFColor |
edgeColor
Color used to draw edges when
edgeColoring or edgeDetect2D is true. |
SoSFBool |
edgeColoring
Enable edge coloring.
|
SoSFBool |
edgeDetect2D
Enable 2D edge detection.
|
SoSFFloat |
edgeDetect2DInnerThreshold
Increase this value to decrease noise on silhouette edges.
|
SoSFBitMask<SoVolumeRenderingQuality.EdgeDetect2DMethods> |
edgeDetect2DMethod
Method used for 2D edge detection.
|
SoSFFloat |
edgeDetect2DOuterThreshold
Increase this value to decrease noise on edges in the volume.
|
SoSFFloat |
edgeThreshold
If this value is low, more edges will be detected.
|
SoSFEnum<SoVolumeRenderingQuality.GradientQualities> |
gradientQuality
Specifies the algorithm used to compute gradients, for example, normals for lighting.
|
SoSFFloat |
gradientThreshold
Ignore all gradients with a magnitude less than the specified threshold.
|
SoSFBool |
jittering
Enable jittering.
|
SoSFBool |
lighting
Enable gradient based lighting (computed on the GPU).
|
SoSFEnum<SoVolumeRenderingQuality.LightingModels> |
lightingModel
Deprecated.
As of Open Inventor 10000 No longer used. OPENGL mode is always used.
|
SoSFBool |
preIntegrated
Enable pre-integrated volume rendering.
|
SoSFBool |
segmentedInterpolation
Allow correct interpolation when rendering segmented data.
|
SoSFFloat |
segmentedInterpolationThreshold
Defines the iso distance used when
segmentedInterpolation is true. |
SoSFFloat |
surfaceScalarExponent
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.
|
SoSFFloat |
unnormalizedGradientExponent
When unnormalizedGradientExponent is not 0, surfaces with high gradients will be more lighted than surfaces with small gradients.
|
SoSFBool |
voxelizedRendering
If true,
SoVolumeRender displays voxels as individual cubes. |
SoSFBool |
voxelOutline
If true, draw the outline of voxels (default is false).
|
SoSFColor |
voxelOutlineColor
When
voxelOutline is true, this value specifies the voxel outline color. |
SoSFFloat |
voxelOutlineThreshold
When
voxelOutline is true, this threshold specifies the minimum size of a voxel, in screen pixels, for the voxel outline to be visible. |
SoSFFloat |
voxelOutlineWidth
When
voxelOutline is true, this value specifies the voxel outline width in pixels. |
forVolumeOnly, interpolateOnMove
bufferObjects, generateTransparency, geometryInputType, geometryOutputType, maxGeometryOutputVertices, patchLength, shaderObject, shadowShader, vertexProgramTwoSide
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoVolumeRenderingQuality()
Constructor.
|
isSupported, isSupported
getFragmentShader, getGeometryShader, getNumReservedTextures, getTessellationControlShader, getTessellationEvaluationShader, getVertexShader, setFragmentShader, setFragmentShader, setGeometryShader, setGeometryShader, setTessellationControlShader, setTessellationControlShader, setTessellationEvaluationShader, setTessellationEvaluationShader, setVertexShader, setVertexShader
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
getNativeResourceHandle
public final SoSFBool lighting
VolumeViz also supports screen space lighting (see the deferredLighting
field).
Notes:
gradientQuality
field.
gradientThreshold
and surfaceScalarExponent
.
SoVolumeRender.lighting
field.
LIMITATIONS
SoDirectionalLight
) are supported.
public final SoSFBool preIntegrated
Limitations:
preIntegrated
field has no effect on SoVolumeIsosurface
rendering.
preIntegrated
field is only considered when SoVolumeRendering.renderMode is set to VOLUME_RENDERING (the default).
public final SoSFBool jittering
SoVolumeRender.samplingAlignment
field to BOUNDARY_ALIGNED. Note: Jittering is only available when pre-integrated rendering is enabled. Default is false. public final SoSFFloat gradientThreshold
lighting
field). public final SoSFBool edgeColoring
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. public final SoSFColor edgeColor
public final SoSFFloat edgeThreshold
public final SoSFBool boundaryOpacity
This effect has a significant performance penalty.
SoVolumeRender.subdivideTile
will be disabled if set to true.
public final SoSFFloat boundaryOpacityIntensity
boundaryOpacity
is true.
If > 1, this increases the boundary opacity globally. If < 1, decreases it. Default is 1.5. public final SoSFFloat boundaryOpacityThreshold
boundaryOpacity
is true.
If this value is low (near 0), only regions with a high gradient will be enhanced. Default is 1.5. public final SoSFBool edgeDetect2D
public final SoSFFloat edgeDetect2DInnerThreshold
public final SoSFFloat edgeDetect2DOuterThreshold
public final SoSFBitMask<SoVolumeRenderingQuality.EdgeDetect2DMethods> edgeDetect2DMethod
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. public final SoSFEnum<SoVolumeRenderingQuality.GradientQualities> gradientQuality
lighting
field).
. Default is MEDIUM.
public final SoSFBool colorInterpolation
lighting
field).
Generally it's better to set the SoVolumeRender.interpolation
field to NEAREST, unless you really want to use gradient based lighting.
public final SoSFFloat surfaceScalarExponent
lighting
field).
public final SoSFFloat unnormalizedGradientExponent
lighting
field).
public final SoSFBool segmentedInterpolation
SoVolumeIsosurface
. public final SoSFFloat segmentedInterpolationThreshold
segmentedInterpolation
is true.
SoVolumeIsosurface
. public final SoSFBool voxelizedRendering
SoVolumeRender
displays voxels as individual cubes.
Default is false.
public final SoSFBool voxelOutline
SoOrthoSlice
etc) in addition to volume rendering.
SoObliqueSlice
, you may see triangles, quadrilaterals and even irregular pentagons in some cases. These lines are correct and correspond to the intersections between the voxels and the oblique slice. For example:
public final SoSFFloat voxelOutlineThreshold
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.
public final SoSFFloat voxelOutlineWidth
voxelOutline
is true, this value specifies the voxel outline width in pixels.
Default is 2 pixels.
public final SoSFColor voxelOutlineColor
voxelOutline
is true, this value specifies the voxel outline color.
Default is black : (0, 0, 0).
public final SoSFBool ambientOcclusion
If you use ambientOcclusion, you should set the SoVolumeRender.samplingAlignment
field to BOUNDARY_ALIGNED to reduce "slicing" artifacts.
NOTE: Only available in raycasting mode.
public final SoSFBool deferredLighting
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:
SoVolumeRender.lighting
field.
LIMITATIONS
SoDirectionalLight
) are supported.
SoVolumeRender.samplingAlignment
field to BOUNDARY_ALIGNED or SMOOTH_BOUNDARY_ALIGNED to reduce "slicing" artifacts.
@Deprecated public final SoSFBool cubicInterpolation
Warning Heavy GPU usage. Primarily useful for still image rendering. Default is false.
SoVolumeShape.interpolation
field instead. @Deprecated public final SoSFEnum<SoVolumeRenderingQuality.LightingModels> lightingModel
lighting
field).
. Default is OIV6.
Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com