SoTransparencyType Class Reference
[Properties]

VSG extension Node that specifies the transparency algorithm to use for shapes. More...

#include <Inventor/nodes/SoTransparencyType.h>

Inheritance diagram for SoTransparencyType:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Types

enum  TransparencyType {
  SCREEN_DOOR = SoGLRenderAction::SCREEN_DOOR,
  ADD = SoGLRenderAction::ADD,
  BLEND = SoGLRenderAction::BLEND,
  DELAYED_ADD = SoGLRenderAction::DELAYED_ADD,
  DELAYED_BLEND = SoGLRenderAction::DELAYED_BLEND,
  SORTED_OBJECT_ADD = SoGLRenderAction::SORTED_OBJECT_ADD,
  SORTED_OBJECT_BLEND = SoGLRenderAction::SORTED_OBJECT_BLEND,
  SORTED_TRIANGLES_ADD = SoGLRenderAction::SORTED_TRIANGLES_ADD,
  SORTED_TRIANGLES_BLEND = SoGLRenderAction::SORTED_TRIANGLES_BLEND,
  SORTED_OBJECT_TRIANGLES_ADD = SoGLRenderAction::SORTED_OBJECT_TRIANGLES_ADD,
  SORTED_OBJECT_TRIANGLES_BLEND = SoGLRenderAction::SORTED_OBJECT_TRIANGLES_BLEND,
  SORTED_PIXELS_BLEND = SoGLRenderAction::SORTED_PIXELS_BLEND,
  SORTED_LAYERS_BLEND = SORTED_PIXELS_BLEND,
  DELAYED_SORTED_PIXELS_BLEND = SoGLRenderAction::DELAYED_SORTED_PIXELS_BLEND,
  DELAYED_SORTED_LAYERS_BLEND = DELAYED_SORTED_PIXELS_BLEND,
  NO_TRANSPARENCY = SoGLRenderAction::NO_TRANSPARENCY
}

Public Member Functions

virtual SoType getTypeId () const
 SoTransparencyType ()
virtual void setOverride (const SbBool state)
virtual SbBool isOverride () const

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoSFEnum type

Detailed Description

VSG extension Node that specifies the transparency algorithm to use for shapes.

The class allows you to specify the transparency algorithm to use for all subsequent shapes. Transparency handling can be completely disabled by setting NO_TRANSPARENCY.

You can also specify the transparency algorithm globally using SoGLRenderAction or the viewer clases (e.g. SoWinRenderArea).

However, there are some differences in behavior depending on which class you use to set the transparency type.

See SoGLRenderAction for a detailed description of when different shapes, including transparent shapes, are rendered during scene graph traversal.

NOTES:

Warning:
This class is not available in Open Inventor version 10 and later.
Starting with Open version 10, transparency type can only be specified as a property of the whole scene.
See the setTransparencyType() method in SoGLRenderAction or the viewer class.

FILE FORMAT/DEFAULT

ACTION BEHAVIOR

SEE ALSO

SoGLRenderAction.

Deprecated:

Deprecated since Open Inventor 9630
Will be removed in OIV 10. Please refer to class documentation for details.

Member Enumeration Documentation

Various levels of transparency rendering quality.

Enumerator:
SCREEN_DOOR 

Uses stipple patterns to simulate transparency.
Note: This algorithm 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.

ADD 

Uses additive alpha blending.

BLEND 

Uses multiplicative alpha blending.

DELAYED_ADD 

Uses additive blending, rendering all transparent objects after opaque ones.
Note: When using this algorithm the OpenGL 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.

DELAYED_BLEND 

Uses multiplicative alpha blending, rendering all transparent objects after opaque ones.
Note: When using this algorithm the OpenGL 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.

SORTED_OBJECT_ADD 

Same as DELAYED_ADD, but sorts transparent objects by distances of bounding boxes from camera. Limitation : If the bounding box of a shape is ignored by setting its boundingBoxIgnoring field to true, the rendering won't be correct.

SORTED_OBJECT_BLEND 

Same as DELAYED_BLEND, but sorts transparent objects by distances of bounding boxes from camera. Limitation : If the bounding box of a shape is ignored by setting its boundingBoxIgnoring field to true, the rendering won't be correct.

SORTED_TRIANGLES_ADD 

Renders all the transparent triangles of the scene using additive blending. All of the transparent triangles of all objects of the scene are collected, and then sorted by triangle position.

SORTED_TRIANGLES_BLEND 

Same as SORTED_TRIANGLES_ADD, but uses multiplicative alpha blending.

SORTED_OBJECT_TRIANGLES_ADD 

Renders all the transparent triangles of the scene using additive blending. All of the triangles of all transparent objects of the scene are collected and then sorted by object.

SORTED_OBJECT_TRIANGLES_BLEND 

Same as SORTED_OBJECT_TRIANGLES_ADD, but uses multiplicative alpha blending.

SORTED_PIXELS_BLEND 

Uses a fragment-level depth sorting technique. This mode generally gives the best results for complex transparent objects.Since Open Inventor 9.4, if the hardware supports the necessary OpenGL features, this transparency mode (and DELAYED_SORTED_PIXELS_BLEND) is implemented using a single-pass, order-independent fragment sorting (K-buffer or A-buffer) algorithm. The required OpenGL hardware features are: shader_image_load_store, shader_atomic_counters and shading_language_420pack. These features are standard in core OpenGL 4.2. Use SoGLExtension, if necessary, to check if they are supported.If the hardware does not support single-pass transparency, then a multi-pass "depth peeling" algorithm is used. The required OpenGL hardware features are: Multi-Texture, Texture Environment Combine, Depth texture, and Shadow . These features are standard starting with OpenGL 1.4. The method setSortedLayersNumPasses() allows you to set the number of rendering passes for more correct transparency. Usually, four passes gives good results.Please note that since some transparency algorithms rely on multi-pass techniques based on the depth of the polygon, there can be issues if several polygons are rendered at the same depth, resulting in incorrect blending. However, rendering polygons at the same depth is highly discouraged even without using advanced transparency since it can result in Z-fighting. Consider using an SoPolygonOffset or SoDepthOffset node to alleviate this issue.If the graphics board does not support multi-pass transparency, SORTED_OBJECT_BLEND is used.Note: If the application uses fragment sorting transparency and specifies a custom fragment shader, the application shader must call an Open Inventor GLSL method instead of setting gl_FragData[0] directly. In the SDK installation, see shaders/include/Inventor/oivDepthPeeling_frag.h Limitations:

  • Antialiasing.
    This transparency type is not compatible with FSAA mode. Use SUPERSAMPLING, FXAA or SMAA instead.
  • Stereo.
    This transparency type is not compatible with interlaced stereo.
  • RenderToTarget.
    This transparency type is not compatible with SoRenderToTarget nodes. In this case, it won't be possible to achieve perfect Order Independent Transparency. Everything under the SoRenderToTarget will be rendered with basic BLEND transparency and in some cases (particularly in SORTED_PIXELS_BLEND) some graphical glitches may be unavoidable.
  • GPU memory.
    Using the single-pass algorithm, it is possible to run out of GPU memory for storing fragment transparency values. This should only happen for scenes with both high depth complexity and a large number of transparent objects. In this case fragments from the objects traversed last in the scene graph may not be sorted correctly, resulting in small artifacts.

SORTED_LAYERS_BLEND 

Deprecated name of SORTED_PIXELS_BLEND.

Deprecated:

Deprecated since Open Inventor 9400
It corresponds to the SORTED_PIXELS_BLEND transparency type.

DELAYED_SORTED_PIXELS_BLEND 

Same as SORTED_PIXELS_BLEND but rendering all transparent objects after opaque ones. See limitations section for SORTED_PIXELS_BLEND!

DELAYED_SORTED_LAYERS_BLEND 

Deprecated name of DELAYED_SORTED_PIXELS_BLEND.

Deprecated:

Deprecated since Open Inventor 9400
It corresponds to the DELAYED_SORTED_PIXELS_BLEND transparency type.

NO_TRANSPARENCY 

Draw all objects as opaque ignoring their transparency.


Constructor & Destructor Documentation

SoTransparencyType::SoTransparencyType (  ) 

Constructor.


Member Function Documentation

static SoType SoTransparencyType::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoNode.

virtual SoType SoTransparencyType::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

virtual SbBool SoTransparencyType::isOverride (  )  const [inline, virtual]

Returns the state of the override field.

Reimplemented from SoNode.

virtual void SoTransparencyType::setOverride ( const SbBool  state  )  [inline, virtual]

Set the state of the override field.

see SoNode::setOverride doc.

Reimplemented from SoNode.


Member Data Documentation

Transparency type.

Use enum TransparencyType. Default is SCREEN_DOOR.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/