Stores the current transparency type. More...
#include <Inventor/elements/SoTransparencyTypeElement.h>
Classes | |
struct | MTstruct |
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 void | print (FILE *fp) const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static int | getClassStackIndex () |
static void | set (SoState *state, TransparencyType type) |
static void | set (SoState *state, SoNode *, TransparencyType type) |
static TransparencyType | get (SoState *state) |
static TransparencyType | getDefault () |
This element stores the current transparency type.
SoTransparencyType, SoGLRenderAction
TransparencyType.
SCREEN_DOOR |
Uses stipple patterns to simulate transparency. |
ADD |
Uses additive alpha blending. |
BLEND |
Uses multiplicative alpha blending. |
DELAYED_ADD |
Uses additive blending, rendering all transparent objects after opaque ones. |
DELAYED_BLEND |
Uses multiplicative alpha blending, rendering all transparent objects after opaque ones. |
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:
|
SORTED_LAYERS_BLEND |
Deprecated name of SORTED_PIXELS_BLEND.
|
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.
|
NO_TRANSPARENCY |
Draw all objects as opaque ignoring their transparency. |
static TransparencyType SoTransparencyTypeElement::get | ( | SoState * | state | ) | [static] |
Returns current draw style from the state.
static int SoTransparencyTypeElement::getClassStackIndex | ( | ) | [static] |
Returns the stack id for this element.
Reimplemented from SoInt32Element.
Reimplemented in SoGLTransparencyTypeElement.
static SoType SoTransparencyTypeElement::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoInt32Element.
Reimplemented in SoGLTransparencyTypeElement.
static TransparencyType SoTransparencyTypeElement::getDefault | ( | ) | [static] |
Returns the default draw style.
virtual void SoTransparencyTypeElement::print | ( | FILE * | fp | ) | const [virtual] |
Prints element (for debugging).
Reimplemented from SoInt32Element.
static void SoTransparencyTypeElement::set | ( | SoState * | state, | |
SoNode * | , | |||
TransparencyType | type | |||
) | [static] |
Sets the current draw style in the state.
static void SoTransparencyTypeElement::set | ( | SoState * | state, | |
TransparencyType | type | |||
) | [static] |
Sets the current draw style in the state.