Package com.openinventor.inventor.nodes
Class SoDepthBuffer
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoDepthBuffer
-
- All Implemented Interfaces:
SafeDisposable
public class SoDepthBuffer extends SoNode
Depth buffer parameters node. This class specifies the depth buffer parameters used for rendering, including:- Depth buffer test enabled,
- Depth buffer writing enabled,
- Depth buffer range, and
- Depth comparison function.
It can also be used to clear the depth buffer by setting the
clearBuffer
field to true.To control whether frame buffer color components are written or not, see
SoColorMask
.Limitations:
- Transparency:
The "depth peeling" transparency types (SORTED_PIXEL) do not work correctly if this node is used to change depth buffer settings. - Test function
By defaultSoDepthBuffer
sets the OpenGL depth buffer test function to LESS. (Meaning that only fragments with a depth value strictly less than the current depth buffer value will be rendered.) This is NOT the same as the Open Inventor default.
By default Open Inventor sets the depth buffer test function to LEQUAL and this value is recommended for most applications. Some Open Inventor features, for exampleSoGradientBackground
, will not work correctly with the depth buffer test function set to LESS.
File format/default:
DepthBuffer {
test true write true function LESS range (0.0,1.0) clearBuffer false Action behavior:
- See Also:
SoPolygonOffset
,SoDepthOffset
,SoColorMask
,SoGLRenderAction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoDepthBuffer.DepthWriteFunctions
Depth function mode as defined by OpenGL.-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFBool
clearBuffer
If true, the depth buffer is cleared when the node is traversed.SoSFEnum<SoDepthBuffer.DepthWriteFunctions>
function
Depth comparison function to use (glDepthFunc).SoSFVec2f
range
Value range for the depth buffer (glDepthRange).SoSFBool
test
Enable depth buffer testing (glEnable).SoSFBool
write
Enable depth buffer writing (glDepthMask).-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoDepthBuffer()
Constructor.
-
Method Summary
-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
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
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
test
public final SoSFBool test
Enable depth buffer testing (glEnable). Default is true.Note that disabling depth testing will prevent the depth buffer from being updated even if depth buffer writing is set to true.
-
write
public final SoSFBool write
Enable depth buffer writing (glDepthMask). Default is true.
-
function
public final SoSFEnum<SoDepthBuffer.DepthWriteFunctions> function
Depth comparison function to use (glDepthFunc). . Default is LESS.
-
range
public final SoSFVec2f range
Value range for the depth buffer (glDepthRange). Default is [0.0-1.0]. The range will be clamped to [0.0-1.0] by OpenGL.
-
clearBuffer
public final SoSFBool clearBuffer
If true, the depth buffer is cleared when the node is traversed. The extent of the buffer that is actually cleared may be limited using anSoViewportClipping
node. Default is false.Note: Be careful when using this feature along with a transparency mode other than
SoGLRenderAction.NO_SORT
because the objects rendering order might be different from their ordering in the scene graph.- Since:
- Open Inventor 8.6
-
-