SoGLRenderActionSetTransparencyType Method |
Sets global transparency algorithm to use when rendering.
Namespace: OIV.Inventor.Actions
. The default is SCREEN_DOOR, but SORTED_PIXELS_BLEND is recommended for most cases. See also getTransparencyType(). Transparency handling can be completely disabled by setting NO_TRANSPARENCY.
The global transparency algorithm can also be set using a method in the viewer class (e.g. SoWinRenderArea.setTransparencyType()). The transparency type can also be set for a portion of the scene graph using the SoTransparencyType node (for all types except SORTED_PIXELS_BLEND and DELAYED_SORTED_PIXELS_BLEND).
The default value for this field can be set using the environment variable OIV_TRANSPARENCY_TYPE.
See SoTransparencyType for more discussion about transparency.
Notes:
SCREEN_DOOR is very fast because it does not require blending, shaders or sorting. However most applications should use one of the other algorithms. Screen door rendering is low quality and only works for polygons with a single transparency (alpha) value for the entire face. Screen door does not correctly handle the case of transparency per vertex or transparent textures.
When using transparency types with DELAYED in the name, the depth buffer is not updated (depth buffer writes are disabled) while rendering transparent objects. As a result complex 3D shapes may not be rendered correctly.
When using a delayed transparency mode, paths to transparent objects are saved in a list. After all opaque objects have been rendered, this list is rendered. In order to avoid unnecessary rendering, the common part of each path is rendered only once. This can increase performance on very complex scene graphs. However, in some cases, it can lead to incorrect rendering. In the figure below, node B is a transparent object and node A has a side effect on node B (clipping, shader...). When the compact path optimization is on (the default), node A will not be traversed during the transparency pass, which will lead to incorrect rendering. When a case like this occurs in your scene graph, set the environment variable OIV_USE_COMPACT_PATHS to false to disable this optimization.