Class RenderingAttributes


public class RenderingAttributes extends NodeComponent
The RenderingAttributes object defines common rendering attributes for all primitive types. The rendering attributes are:

  • Depth test function - used to compare the incoming (source) depth of each pixel with depth of the pixel stored in frame buffer. If the test passes, the pixel is written, otherwise the pixel is not written. The depth test function is set with the setDepthTestFunction method. By default, LESS_OR_EQUAL is the function used. The depth test function is one of the following:
    • ALWAYS - pixels are always drawn, irrespective of the depth value. This effectively disables depth testing.
    • NEVER - pixels are never drawn, irrespective of the depth value.
    • EQUAL - pixels are drawn if the incoming pixel depth is equal to the stored pixel depth in the frame buffer.
    • NOT_EQUAL - pixels are drawn if the incoming pixel depth is not equal to the stored pixel depth in the frame buffer.
    • LESS - pixels are drawn if the incoming pixel depth is less than the stored pixel depth in the frame buffer.
    • LESS_OR_EQUAL - pixels are drawn if the incoming pixel depth is less than or equal to the stored pixel depth in the frame buffer. This is the default setting.
    • GREATER - pixels are drawn if the incoming pixel depth is greater than the stored pixel depth in the frame buffer.
    • GREATER_OR_EQUAL - pixels are drawn if the incoming pixel depth is greater than or equal to the stored pixel depth in the frame buffer.
  • Alpha test function - used to compare the incoming (source) alpha value of each pixel with the alpha test value. If the test passes, the pixel is written, otherwise the pixel is not written. The alpha test function is set with the setAlphaTestFunction method. The alpha test function is one of the following:
    • ALWAYS - pixels are always drawn, irrespective of the alpha value. This effectively disables alpha testing. This is the default setting.
    • NEVER - pixels are never drawn, irrespective of the alpha value.
    • EQUAL - pixels are drawn if the incoming pixel alpha value is equal to the alpha test value.
    • NOT_EQUAL - pixels are drawn if the incoming pixel alpha value is not equal to the alpha test value.
    • LESS - pixels are drawn if the incoming pixel alpha value is less than the alpha test value.
    • LESS_OR_EQUAL - pixels are drawn if the incoming pixel alpha value is less than or equal to the alpha test value.
    • GREATER - pixels are drawn if the incoming pixel alpha value is greater than the alpha test value.
    • GREATER_OR_EQUAL - pixels are drawn if the incoming pixel alpha value is greater than or equal to the alpha test value.
  • Alpha test value - the test value used by the alpha test function. This value is compared to the alpha value of each rendered pixel. The alpha test value is set with the setAlphaTestValue method. The default alpha test value is 0.0.
  • Raster operation - the raster operation function for this RenderingAttributes component object. The raster operation is set with the setRasterOp method. The raster operation is enabled or disabled with the setRasterOpEnable method. The raster operation is one of the following:
    • ROP_CLEAR - DST = 0.
    • ROP_AND DST = SRC invalid input: '&' DST.
    • ROP_AND_REVERSE DST = SRC invalid input: '&' ~DST.
    • ROP_COPY - DST = SRC. This is the default operation.
    • ROP_AND_INVERTED - DST = ~SRC invalid input: '&' DST.
    • ROP_NOOP - DST = DST.
    • ROP_XOR - DST = SRC ^ DST.
    • ROP_OR - DST = DST | SRC.
    • ROP_NOR - DST = ~( DST | SRC .)
    • ROP_EQUIV - DST = ~( DST ^ SRC .)
    • ROP_INVERT - DST = ~DST.
    • ROP_OR_REVERSE - DST = src | ~DST.
    • ROP_COPY_INVERTED - DST = ~SRC.
    • ROP_OR_INVERTED - DST = ~SRC | DST.
    • ROP_NAND - DST = ~(SRC invalid input: '&' DST.)
    • ROP_SET - DST = 1.
  • Vertex colors - vertex colors can be ignored for this RenderingAttributes object. This capability is set with the setIgnoreVertexColors method. If ignoreVertexColors is false, per-vertex colors are used, when present in the associated geometry objects, taking precedence over the ColoringAttributes color and the specified Material color(s). If ignoreVertexColors is true, per-vertex colors are ignored. In this case, if lighting is enabled, the Material diffuse color will be used as the object color. if lighting is disabled, the ColoringAttributes color is used. The default value is false.
  • Visibility flag - when set, invisible objects are not rendered (subject to the visibility policy for the current view), but they can be picked or collided with. This flag is set with the setVisible method. By default, the visibility flag is true.
  • Depth buffer - can be enabled or disabled for this RenderingAttributes component object. The setDepthBufferEnable method enables or disabled the depth buffer. The setDepthBufferWriteEnable method enables or disables writing the depth buffer for this object. During the transparent rendering pass, this attribute can be overridden by the depthBufferFreezeTransparent attribute in the View object. Transparent objects include BLENDED transparent and antialiased lines and points. Transparent objects do not include opaque objects or primitives rendered with SCREEN_DOOR transparency. By default, the depth buffer is enabled and the depth buffer write is enabled.
  • Stencil buffer - can be enabled or disabled for this RenderingAttributes component object using the setStencilEnable method. If the stencil buffer is disabled, the stencil operation and function are ignored. If a scene graph is rendered on a Canvas3D that does not have a stencil buffer, the stencil buffer will be implicitly disabled for that canvas.
  • Stencil write mask - mask that controls which bits of the stencil buffer are written when the stencil buffer is enabled. The default value is ~0 (all ones).
  • Stencil operation - a set of three stencil operations performed when: 1) the stencil test fails; 2) the stencil test passes, but the depth test fails; or 3) both the stencil test and depth test pass. The stencil operations are set with the setStencilOp method. The stencil operation is one of the following:
    • STENCIL_KEEP - keeps the current value (no operation performed). This is the default setting.
    • STENCIL_ZERO - Sets the stencil buffer value to 0.
    • STENCIL_REPLACE - Sets the stencil buffer value to refValue, as specified by setStencilFunction.
    • STENCIL_INCR - Increments the current stencil buffer value.
    • STENCIL_DECR - Decrements the current stencil buffer value.
    • STENCIL_INVERT - Bitwise inverts the current stencil buffer value.
  • Stencil test function - used to compare the stencil reference value with the per-pixel stencil value stored in the frame buffer. If the test passes, the pixel is written, otherwise the pixel is not written. The stencil test function, reference value, and comparison mask are set with the setStencilFunction method. The stencil comparison mask is bitwise-ANDed with both the stencil reference value and the stored stencil value prior to doing the comparison. The default value for the reference value is 0. The default value for the comparison mask is ~0 (all ones). The stencil test function is one of the following:
    • ALWAYS - pixels are always drawn, irrespective of the stencil value. This effectively disables stencil testing. This is the default setting.
    • NEVER - pixels are never drawn, irrespective of the stencil value.
    • EQUAL - pixels are drawn if the stencil reference value is equal to the stored stencil value in the frame buffer.
    • NOT_EQUAL - pixels are drawn if the stencil reference value is not equal to the stored stencil value in the frame buffer.
    • LESS - pixels are drawn if the stencil reference value is less than the stored stencil value in the frame buffer.
    • LESS_OR_EQUAL - pixels are drawn if the stencil reference value is less than or equal to the stored stencil value in the frame buffer.
    • GREATER - pixels are drawn if the stencil reference value is greater than the stored stencil value in the frame buffer.
    • GREATER_OR_EQUAL - pixels are drawn if the stencil reference value is greater than or equal to the stored stencil value in the frame buffer.

Note: the alpha test, depth test, and stencil functions all use the same enums.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Specifies that this RenderingAttributes object allows reading its alpha test function component information.
    static final int
    Specifies that this RenderingAttributes object allows writing its alpha test function component information.
    static final int
    Specifies that this RenderingAttributes object allows reading its alpha test value component information.
    static final int
    Specifies that this RenderingAttributes object allows writing its alpha test value component information.
    static final int
    Specifies that this RenderingAttributes object allows reading its depth buffer enable and depth buffer write enable component information.
    static final int
    Specifies that this RenderingAttributes object allows writing its depth buffer enable and depth buffer write enable component information.
    static final int
    Specifies that this RenderingAttributes object allows reading its depth test function component information.
    static final int
    Specifies that this RenderingAttributes object allows writing its depth test function component information.
    static final int
    Specifies that this RenderingAttributes object allows reading its ignore vertex colors information.
    static final int
    Specifies that this RenderingAttributes object allows writing its ignore vertex colors information.
    static final int
    Specifies that this RenderingAttributes object allows reading its raster operation information.
    static final int
    Specifies that this RenderingAttributes object allows writing its raster operation information.
    static final int
    Specifies that this RenderingAttributes object allows reading its stencil enable, stencil op, stencil function, and stencil write mask information.
    static final int
    Specifies that this RenderingAttributes object allows writing its stencil enable, stencil op, stencil function, and stencil write mask information.
    static final int
    Specifies that this RenderingAttributes object allows reading its visibility information.
    static final int
    Specifies that this RenderingAttributes object allows writing its visibility information.
    static final int
    Specifies that pixels are always drawn irrespective of the values being tested.
    static final int
    Specifies that pixels are drawn if the two values being tested are equal.
    static final int
    Specifies that pixels are drawn if the source/reference value is greater than the destination/test value.
    static final int
    Specifies that pixels are drawn if the source/reference value is greater than or equal to the destination/test value.
    static final int
    Specifies that pixels are drawn if the source/reference value is less than the destination/test value.
    static final int
    Specifies that pixels are drawn if the source/reference value is less than or equal to the destination/test value.
    static final int
    Specifies that pixels are never drawn irrespective of the values being tested.
    static final int
    Specifies that pixels are drawn if the two values being tested are not equal.
    static final int
    Raster operation: DST = SRC invalid input: '&' DST.
    static final int
    Raster operation: DST = ~SRC invalid input: '&' DST.
    static final int
    Raster operation: DST = SRC invalid input: '&' ~DST.
    static final int
    Raster operation: DST = 0.
    static final int
    Raster operation: DST = SRC.
    static final int
    Raster operation: DST = ~SRC.
    static final int
    Raster operation: DST = ~( DST ^ SRC ).
    static final int
    Raster operation: DST = ~DST.
    static final int
    Raster operation: DST = ~(SRC invalid input: '&' DST).
    static final int
    Raster operation: DST = DST.
    static final int
    Raster operation: DST = ~( DST | SRC ).
    static final int
    Raster operation: DST = DST | SRC.
    static final int
    Raster operation: DST = ~SRC | DST.
    static final int
    Raster operation: DST = src | ~DST.
    static final int
    Raster operation: DST = 1.
    static final int
    Raster operation: DST = SRC ^ DST.
    static final int
    Stencil operation: DST = DST - 1
    static final int
    Stencil operation: DST = DST + 1
    static final int
    Stencil operation: DST = ~DST
    static final int
    Stencil operation: DST = DST
    static final int
    Stencil operation: DST = REF
    static final int
    Stencil operation: DST = 0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a RenderingAttributes object with default parameters.
    RenderingAttributes(boolean depthBufferEnable, boolean depthBufferWriteEnable, float alphaTestValue, int alphaTestFunction)
    Constructs a RenderingAttributes object with specified values.
    RenderingAttributes(boolean depthBufferEnable, boolean depthBufferWriteEnable, float alphaTestValue, int alphaTestFunction, boolean visible, boolean ignoreVertexColors, boolean rasterOpEnable, int rasterOp)
    Constructs a RenderingAttributes object with specified values
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    replaced with cloneNodeComponent(boolean forceDuplicate)
    int
    Retrieves current alpha test function.
    float
    Retrieves the alpha test value.
    boolean
    Retrieves the state of zBuffer Enable flag
    boolean
    Retrieves the state of Depth Buffer Write Enable flag.
    int
    Retrieves current depth test function.
    boolean
    Retrieves the ignoreVertexColors flag for this RenderingAttributes object.
    int
    Retrieves the current raster operation for this RenderingAttributes object.
    boolean
    Retrieves the rasterOp enable flag for this RenderingAttributes object.
    boolean
    Retrieves the stencil buffer enable flag for this RenderingAttributes object.
    void
    getStencilFunction(int[] params)
    Retrieves the stencil function, reference value, and comparison mask, and copies them into the specified array.
    void
    getStencilOp(int[] stencilOps)
    Retrieves the current set of stencil operations, and copies them into the specified array.
    int
    Retrieves the current stencil write mask for this RenderingAttributes object.
    boolean
    Retrieves the visibility flag for this RenderingAttributes object.
    void
    setAlphaTestFunction(int function)
    Set alpha test function.
    void
    setAlphaTestValue(float value)
    Set alpha test value used by alpha test function.
    void
    setDepthBufferEnable(boolean state)
    Enables or disables depth buffer mode for this RenderingAttributes component object.
    void
    Enables or disables writing the depth buffer for this object.
    void
    setDepthTestFunction(int function)
    Set depth test function.
    void
    setIgnoreVertexColors(boolean ignoreVertexColors)
    Sets a flag that indicates whether vertex colors are ignored for this RenderingAttributes object.
    void
    setRasterOp(int rasterOp)
    Sets the raster operation function for this RenderingAttributes component object.
    void
    setRasterOpEnable(boolean rasterOpEnable)
    Sets the rasterOp enable flag for this RenderingAttributes component object.
    void
    setStencilEnable(boolean state)
    Enables or disables the stencil buffer for this RenderingAttributes component object.
    void
    setStencilFunction(int[] params)
    Sets the stencil function, reference value, and comparison mask for this RenderingAttributes object to the specified parameters.
    void
    setStencilFunction(int function, int refValue, int compareMask)
    Sets the stencil function, reference value, and comparison mask for this RenderingAttributes object to the specified parameters.
    void
    setStencilOp(int[] stencilOps)
    Sets the stencil operations for this RenderingAttributes object to the specified parameters.
    void
    setStencilOp(int failOp, int zFailOp, int zPassOp)
    Sets the stencil operations for this RenderingAttributes object to the specified parameters.
    void
    Sets the stencil write mask for this RenderingAttributes object.
    void
    setVisible(boolean visible)
    Sets the visibility flag for this RenderingAttributes component object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • RenderingAttributes

      public RenderingAttributes()
      Constructs a RenderingAttributes object with default parameters. The default values are as follows:
        depth buffer enable : true
        depth buffer write enable : true
        alpha test function : ALWAYS
        alpha test value : 0.0f
        visible : true
        ignore vertex colors : false
        raster operation enable : false
        raster operation : ROP_COPY
        depth test: LESS_OR_EQUAL
        stencil enable : false
        stencil write mask : ~0 (all ones)
        stencil op - failOp : STENCIL_KEEP
        stencil op - zFailOp : STENCIL_KEEP
        stencil op - zPassOp : STENCIL_KEEP
        stencil function : ALWAYS
        stencil reference value : 0
        stencil comparison mask : ~0 (all ones)
    • RenderingAttributes

      public RenderingAttributes(boolean depthBufferEnable, boolean depthBufferWriteEnable, float alphaTestValue, int alphaTestFunction)
      Constructs a RenderingAttributes object with specified values.
      Parameters:
      depthBufferEnable - a flag to turn depth buffer on/off
      depthBufferWriteEnable - a flag to to make depth buffer read/write or read only
      alphaTestValue - the alpha test reference value
      alphaTestFunction - the function for comparing alpha values
    • RenderingAttributes

      public RenderingAttributes(boolean depthBufferEnable, boolean depthBufferWriteEnable, float alphaTestValue, int alphaTestFunction, boolean visible, boolean ignoreVertexColors, boolean rasterOpEnable, int rasterOp)
      Constructs a RenderingAttributes object with specified values
      Parameters:
      depthBufferEnable - a flag to turn depth buffer on/off
      depthBufferWriteEnable - a flag to make depth buffer read/write or read only
      alphaTestValue - the alpha test reference value
      alphaTestFunction - the function for comparing alpha values
      visible - a flag that specifies whether the object is visible
      ignoreVertexColors - a flag to enable or disable the ignoring of per-vertex colors
      rasterOpEnable - a flag that specifies whether logical raster operations are enabled for this RenderingAttributes object. This disables all alpha blending operations.
      rasterOp - the logical raster operation, one of: ROP_CLEAR, ROP_AND, ROP_AND_REVERSE, ROP_COPY, ROP_AND_INVERTED, ROP_NOOP, ROP_XOR, ROP_OR, ROP_NOR, ROP_EQUIV, ROP_INVERT, ROP_OR_REVERSE, ROP_COPY_INVERTED, ROP_OR_INVERTED, ROP_NAND or ROP_SET
      Since:
      Java 3D 1.2
  • Method Details

    • setDepthBufferEnable

      public void setDepthBufferEnable(boolean state)
      Enables or disables depth buffer mode for this RenderingAttributes component object.
      Parameters:
      state - true or false to enable or disable depth buffer mode
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      See Also:
    • getDepthBufferEnable

      public boolean getDepthBufferEnable()
      Retrieves the state of zBuffer Enable flag
      Returns:
      true if depth buffer mode is enabled, false if depth buffer mode is disabled
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
    • setDepthBufferWriteEnable

      public void setDepthBufferWriteEnable(boolean state)
      Enables or disables writing the depth buffer for this object. During the transparent rendering pass, this attribute can be overridden by the depthBufferFreezeTransparent attribute in the View object.
      Parameters:
      state - true or false to enable or disable depth buffer Write mode
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      See Also:
    • getDepthBufferWriteEnable

      public boolean getDepthBufferWriteEnable()
      Retrieves the state of Depth Buffer Write Enable flag.
      Returns:
      true if depth buffer is writable, false if depth buffer is read-only
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
    • setAlphaTestValue

      public void setAlphaTestValue(float value)
      Set alpha test value used by alpha test function. This value is compared to the alpha value of each rendered pixel.
      Parameters:
      value - the alpha test value
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
    • getAlphaTestValue

      public float getAlphaTestValue()
      Retrieves the alpha test value.
      Returns:
      the alpha test value.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
    • setAlphaTestFunction

      public void setAlphaTestFunction(int function)
      Set alpha test function. This function is used to compare each incoming (source) per-pixel alpha value with the alpha test value. If the test passes, the pixel is written otherwise the pixel is not written.
      Parameters:
      function - the new alpha test function. One of ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, GREATER_OR_EQUAL
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
    • getAlphaTestFunction

      public int getAlphaTestFunction()
      Retrieves current alpha test function.
      Returns:
      the current alpha test function
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
    • setVisible

      public void setVisible(boolean visible)
      Sets the visibility flag for this RenderingAttributes component object. Invisible objects are not rendered (subject to the visibility policy for the current view), but they can be picked or collided with. The default value is true.
      Parameters:
      visible - true or false to enable or disable visibility
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.2
      See Also:
    • getVisible

      public boolean getVisible()
      Retrieves the visibility flag for this RenderingAttributes object.
      Returns:
      true if the object is visible; false if the object is invisible.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.2
    • setIgnoreVertexColors

      public void setIgnoreVertexColors(boolean ignoreVertexColors)
      Sets a flag that indicates whether vertex colors are ignored for this RenderingAttributes object. If ignoreVertexColors is false, per-vertex colors are used, when present in the associated Geometry objects, taking precedence over the ColoringAttributes color and the specified Material color(s). If ignoreVertexColors is true, per-vertex colors are ignored. In this case, if lighting is enabled, the Material diffuse color will be used as the object color. If lighting is disabled, the ColoringAttributes color will be used. The default value is false.
      Parameters:
      ignoreVertexColors - true or false to enable or disable the ignoring of per-vertex colors
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.2
      See Also:
    • getIgnoreVertexColors

      public boolean getIgnoreVertexColors()
      Retrieves the ignoreVertexColors flag for this RenderingAttributes object.
      Returns:
      true if per-vertex colors are ignored; false if per-vertex colors are used.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.2
    • setRasterOpEnable

      public void setRasterOpEnable(boolean rasterOpEnable)
      Sets the rasterOp enable flag for this RenderingAttributes component object. When set to true, this enables logical raster operations as specified by the setRasterOp method. Enabling raster operations effectively disables alpha blending, which is used for transparency and antialiasing. Raster operations, especially XOR mode, are primarily useful when rendering to the front buffer in immediate mode. Most applications will not wish to enable this mode.
      Parameters:
      rasterOpEnable - true or false to enable or disable raster operations
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.2
      See Also:
    • getRasterOpEnable

      public boolean getRasterOpEnable()
      Retrieves the rasterOp enable flag for this RenderingAttributes object.
      Returns:
      true if raster operations are enabled; false if raster operations are disabled.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.2
    • setRasterOp

      public void setRasterOp(int rasterOp)
      Sets the raster operation function for this RenderingAttributes component object.
      Parameters:
      rasterOp - the logical raster operation, one of: ROP_CLEAR, ROP_AND, ROP_AND_REVERSE, ROP_COPY, ROP_AND_INVERTED, ROP_NOOP, ROP_XOR, ROP_OR, ROP_NOR, ROP_EQUIV, ROP_INVERT, ROP_OR_REVERSE, ROP_COPY_INVERTED, ROP_OR_INVERTED, ROP_NAND or ROP_SET.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.2
    • getRasterOp

      public int getRasterOp()
      Retrieves the current raster operation for this RenderingAttributes object.
      Returns:
      one of: ROP_CLEAR, ROP_AND, ROP_AND_REVERSE, ROP_COPY, ROP_AND_INVERTED, ROP_NOOP, ROP_XOR, ROP_OR, ROP_NOR, ROP_EQUIV, ROP_INVERT, ROP_OR_REVERSE, ROP_COPY_INVERTED, ROP_OR_INVERTED, ROP_NAND or ROP_SET
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.2
    • cloneNodeComponent

      public NodeComponent cloneNodeComponent()
      Deprecated.
      replaced with cloneNodeComponent(boolean forceDuplicate)
      Overrides:
      cloneNodeComponent in class NodeComponent
    • setDepthTestFunction

      public void setDepthTestFunction(int function)
      Set depth test function. This function is used to compare each incoming (source) per-pixel depth test value with the stored per-pixel depth value in the frame buffer. If the test passes, the pixel is written, otherwise the pixel is not written.
      Parameters:
      function - the new depth test function. One of ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, or GREATER_OR_EQUAL. The default value is LESS_OR_EQUAL.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
    • getDepthTestFunction

      public int getDepthTestFunction()
      Retrieves current depth test function.
      Returns:
      the current depth test function
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
    • setStencilEnable

      public void setStencilEnable(boolean state)
      Enables or disables the stencil buffer for this RenderingAttributes component object. If the stencil buffer is disabled, the stencil operation and function are ignored. If a scene graph is rendered on a Canvas3D that does not have a stencil buffer, the stencil buffer will be implicitly disabled for that canvas.
      Parameters:
      state - true or false to enable or disable stencil buffer operations. If this is set to false, the stencilOp and stencilFunction parameters are not used.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
      See Also:
    • getStencilEnable

      public boolean getStencilEnable()
      Retrieves the stencil buffer enable flag for this RenderingAttributes object.
      Returns:
      true if stencil buffer operations are enabled; false if stencil buffer operations are disabled.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
    • setStencilOp

      public void setStencilOp(int failOp, int zFailOp, int zPassOp)
      Sets the stencil operations for this RenderingAttributes object to the specified parameters.
      Parameters:
      failOp - operation performed when the stencil test fails, one of: STENCIL_KEEP, STENCIL_ZERO, STENCIL_REPLACE, STENCIL_INCR, STENCIL_DECR, or STENCIL_INVERT.
      zFailOp - operation performed when the stencil test passes and the depth test fails, one of: STENCIL_KEEP, STENCIL_ZERO, STENCIL_REPLACE, STENCIL_INCR, STENCIL_DECR, or STENCIL_INVERT.
      zPassOp - operation performed when both the stencil test and the depth test pass, one of: STENCIL_KEEP, STENCIL_ZERO, STENCIL_REPLACE, STENCIL_INCR, STENCIL_DECR, or STENCIL_INVERT.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
    • setStencilOp

      public void setStencilOp(int[] stencilOps)
      Sets the stencil operations for this RenderingAttributes object to the specified parameters.
      Parameters:
      stencilOps - an array of three integers that specifies the new set of stencil operations. Element 0 of the array specifies the failOp parameter, element 1 specifies the zFailOp parameter, and element 2 specifies the zPassOp parameter.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
      See Also:
    • getStencilOp

      public void getStencilOp(int[] stencilOps)
      Retrieves the current set of stencil operations, and copies them into the specified array. The caller must ensure that this array has been allocated with enough space to hold the results.
      Parameters:
      stencilOps - array that will receive the current set of three stencil operations. The failOp parameter is copied into element 0 of the array, the zFailOp parameter is copied into element 1, and the zPassOp parameter is copied into element 2.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
    • setStencilFunction

      public void setStencilFunction(int function, int refValue, int compareMask)
      Sets the stencil function, reference value, and comparison mask for this RenderingAttributes object to the specified parameters.
      Parameters:
      function - the stencil test function, used to compare the stencil reference value with the stored per-pixel stencil value in the frame buffer. If the test passes, the pixel is written, otherwise the pixel is not written. The stencil function is one of: ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, or GREATER_OR_EQUAL.
      refValue - the stencil reference value that is tested against the stored per-pixel stencil value
      compareMask - a mask that limits which bits are compared; it is bitwise-ANDed with both the stencil reference value and the stored per-pixel stencil value before doing the comparison.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
    • setStencilFunction

      public void setStencilFunction(int[] params)
      Sets the stencil function, reference value, and comparison mask for this RenderingAttributes object to the specified parameters.
      Parameters:
      params - an array of three integers that specifies the new stencil function, reference value, and comparison mask. Element 0 of the array specifies the stencil function, element 1 specifies the reference value, and element 2 specifies the comparison mask.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
      See Also:
    • getStencilFunction

      public void getStencilFunction(int[] params)
      Retrieves the stencil function, reference value, and comparison mask, and copies them into the specified array. The caller must ensure that this array has been allocated with enough space to hold the results.
      Parameters:
      params - array that will receive the current stencil function, reference value, and comparison mask. The stencil function is copied into element 0 of the array, the reference value is copied into element 1, and the comparison mask is copied into element 2.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
    • setStencilWriteMask

      public void setStencilWriteMask(int mask)
      Sets the stencil write mask for this RenderingAttributes object. This mask controls which bits of the stencil buffer are written. The default value is ~0 (all ones).
      Parameters:
      mask - the new stencil write mask.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4
    • getStencilWriteMask

      public int getStencilWriteMask()
      Retrieves the current stencil write mask for this RenderingAttributes object.
      Returns:
      the stencil write mask.
      Throws:
      CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
      Since:
      Java 3D 1.4