Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.media.j3d
Class RenderingAttributes

    java.lang.Object
      javax.media.j3d.SceneGraphObject
          javax.media.j3d.NodeComponent
              javax.media.j3d.RenderingAttributes

    public class RenderingAttributes

extends NodeComponent

The RenderingAttributes object defines common rendering attributes for all primitive types. The rendering attributes are:

- Alpha test function - used to compare the alpha test value with each per-pixel alpha 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 pixel alpha value is equal to the alpha test value.

- NOT_EQUAL - pixels are drawn if the pixel alpha value is not equal to the alpha test value.

- LESS - pixels are drawn if the pixel alpha value is less than the alpha test value.

- LESS_OR_EQUAL - pixels are drawn if the pixel alpha value is less than or equal to the alpha test value.

- GREATER - pixels are drawn if the pixel alpha value is greater than the alpha test value.

- GREATER_OR_EQUAL - pixels are drawn if the 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_COPY - DST = SRC. This is the default operation.
- ROP_XOR - DST = SRC ^ DST.

- 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.

See Also:
  `Appearance`

Field Summary
`static int` | `ALLOW_ALPHA_TEST_FUNCTION_READ` Specifies that this RenderingAttributes object allows reading its alpha test function component information.
`static int` | `ALLOW_ALPHA_TEST_FUNCTION_WRITE` Specifies that this RenderingAttributes object allows writing its alpha test function component information.
`static int` | `ALLOW_ALPHA_TEST_VALUE_READ` Specifies that this RenderingAttributes object allows reading its alpha test value component information.
`static int` | `ALLOW_ALPHA_TEST_VALUE_WRITE` Specifies that this RenderingAttributes object allows writing its alpha test value component information.
`static int` | `ALLOW_DEPTH_ENABLE_READ` Specifies that this RenderingAttributes object allows reading its depth buffer enable and depth buffer write enable component information.
`static int` | `ALLOW_DEPTH_ENABLE_WRITE` Specifies that this RenderingAttributes object allows writing its depth buffer enable and depth buffer write enable component information.
`static int` | `ALLOW_IGNORE_VERTEX_COLORS_READ` Specifies that this RenderingAttributes object allows reading its ignore vertex colors information.
`static int` | `ALLOW_IGNORE_VERTEX_COLORS_WRITE` Specifies that this RenderingAttributes object allows writing its ignore vertex colors information.
`static int` | `ALLOW_RASTER_OP_READ` Specifies that this RenderingAttributes object allows reading its raster operation information.
`static int` | `ALLOW_RASTER_OP_WRITE` Specifies that this RenderingAttributes object allows writing its raster operation information.
`static int` | `ALLOW_VISIBLE_READ` Specifies that this RenderingAttributes object allows reading its visibility information.
`static int` | `ALLOW_VISIBLE_WRITE` Specifies that this RenderingAttributes object allows writing its visibility information.
`static int` | `ALWAYS` Indicates pixels are always drawn irrespective of alpha value.
`static int` | `EQUAL` Indicates pixels are drawn if pixel alpha value is equal to alpha test value.
`static int` | `GREATER` Indicates pixels are drawn if pixel alpha value is greater than alpha test value.
`static int` | `GREATER_OR_EQUAL` Indicates pixels are drawn if pixel alpha value is greater than or equal to alpha test value.
`static int` | `LESS` Indicates pixels are drawn if pixel alpha value is less than alpha test value.
`static int` | `LESS_OR_EQUAL` Indicates pixels are drawn if pixel alpha value is less than or equal to alpha test value.
`static int` | `NEVER` Indicates pixels are never drawn irrespective of alpha value.
`static int` | `NOT_EQUAL` Indicates pixels are drawn if pixel alpha value is not equal to alpha test value.
`static int` | `ROP_COPY` Raster operation: `DST = SRC`.
`static int` | `ROP_XOR` Raster operation: `DST = SRC ^ DST`.

Constructor Summary
`RenderingAttributes()` 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
`NodeComponent` | `cloneNodeComponent()` Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate)
`int` | `getAlphaTestFunction()` Retrieves current alpha test function.
`float` | `getAlphaTestValue()` Retrieves the alpha test value.
`boolean` | `getDepthBufferEnable()` Retrieves the state of zBuffer Enable flag
`boolean` | `getDepthBufferWriteEnable()` Retrieves the state of Depth Buffer Write Enable flag.
`boolean` | `getIgnoreVertexColors()` Retrieves the ignoreVertexColors flag for this RenderingAttributes object.
`int` | `getRasterOp()` Retrieves the current raster operation for this RenderingAttributes object.
`boolean` | `getRasterOpEnable()` Retrieves the rasterOp enable flag for this RenderingAttributes object.
`boolean` | `getVisible()` 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` | `setDepthBufferWriteEnable(boolean state)` Enables or disables writing the depth buffer for this object.
`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` | `setVisible(boolean visible)` Sets the visibility flag for this RenderingAttributes component object.

Methods inherited from class javax.media.j3d.NodeComponent
`cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree`

Methods inherited from class javax.media.j3d.SceneGraphObject
`clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData, updateNodeReferences`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ALLOW_ALPHA_TEST_VALUE_READ

    public static final int ALLOW_ALPHA_TEST_VALUE_READ

  Specifies that this RenderingAttributes object allows reading its alpha test value component information.

  See Also:
    Constant Field Values

### ALLOW_ALPHA_TEST_VALUE_WRITE

    public static final int ALLOW_ALPHA_TEST_VALUE_WRITE

  Specifies that this RenderingAttributes object allows writing its alpha test value component information.

  See Also:
    Constant Field Values

### ALLOW_ALPHA_TEST_FUNCTION_READ

    public static final int ALLOW_ALPHA_TEST_FUNCTION_READ

  Specifies that this RenderingAttributes object allows reading its alpha test function component information.

  See Also:
    Constant Field Values

### ALLOW_ALPHA_TEST_FUNCTION_WRITE

    public static final int ALLOW_ALPHA_TEST_FUNCTION_WRITE

  Specifies that this RenderingAttributes object allows writing its alpha test function component information.

  See Also:
    Constant Field Values

### ALLOW_DEPTH_ENABLE_READ

    public static final int ALLOW_DEPTH_ENABLE_READ

  Specifies that this RenderingAttributes object allows reading its depth buffer enable and depth buffer write enable component information.

  See Also:
    Constant Field Values

### ALLOW_DEPTH_ENABLE_WRITE

    public static final int ALLOW_DEPTH_ENABLE_WRITE

  Specifies that this RenderingAttributes object allows writing its depth buffer enable and depth buffer write enable component information.

  Since:
    Java 3D 1.3
  See Also:
    Constant Field Values

### ALLOW_VISIBLE_READ

    public static final int ALLOW_VISIBLE_READ

  Specifies that this RenderingAttributes object allows reading its visibility information.

  Since:
    Java 3D 1.2
  See Also:
    Constant Field Values

### ALLOW_VISIBLE_WRITE

    public static final int ALLOW_VISIBLE_WRITE

  Specifies that this RenderingAttributes object allows writing its visibility information.

  Since:
    Java 3D 1.2
  See Also:
    Constant Field Values

### ALLOW_IGNORE_VERTEX_COLORS_READ

    public static final int ALLOW_IGNORE_VERTEX_COLORS_READ

  Specifies that this RenderingAttributes object allows reading its ignore vertex colors information.

  Since:
    Java 3D 1.2
  See Also:
    Constant Field Values

### ALLOW_IGNORE_VERTEX_COLORS_WRITE

    public static final int ALLOW_IGNORE_VERTEX_COLORS_WRITE

  Specifies that this RenderingAttributes object allows writing its ignore vertex colors information.

  Since:
    Java 3D 1.2
  See Also:
    Constant Field Values

### ALLOW_RASTER_OP_READ

    public static final int ALLOW_RASTER_OP_READ

  Specifies that this RenderingAttributes object allows reading its raster operation information.

  Since:
    Java 3D 1.2
  See Also:
    Constant Field Values

### ALLOW_RASTER_OP_WRITE

    public static final int ALLOW_RASTER_OP_WRITE

  Specifies that this RenderingAttributes object allows writing its raster operation information.

  Since:
    Java 3D 1.2
  See Also:
    Constant Field Values

### ALWAYS

    public static final int ALWAYS

  Indicates pixels are always drawn irrespective of alpha value. This effectively disables alpha testing.

  See Also:
    Constant Field Values

### NEVER

    public static final int NEVER

  Indicates pixels are never drawn irrespective of alpha value.

  See Also:
    Constant Field Values

### EQUAL

    public static final int EQUAL

  Indicates pixels are drawn if pixel alpha value is equal to alpha test value.

  See Also:
    Constant Field Values

### NOT_EQUAL

    public static final int NOT_EQUAL

  Indicates pixels are drawn if pixel alpha value is not equal to alpha test value.

  See Also:
    Constant Field Values

### LESS

    public static final int LESS

  Indicates pixels are drawn if pixel alpha value is less than alpha test value.

  See Also:
    Constant Field Values

### LESS_OR_EQUAL

    public static final int LESS_OR_EQUAL

  Indicates pixels are drawn if pixel alpha value is less than or equal to alpha test value.

  See Also:
    Constant Field Values

### GREATER

    public static final int GREATER

  Indicates pixels are drawn if pixel alpha value is greater than alpha test value.

  See Also:
    Constant Field Values

### GREATER_OR_EQUAL

    public static final int GREATER_OR_EQUAL

  Indicates pixels are drawn if pixel alpha value is greater than or equal to alpha test value.

  See Also:
    Constant Field Values

### ROP_COPY

    public static final int ROP_COPY

  Raster operation: `DST = SRC`.

  Since:
    Java 3D 1.2
  See Also:
    `setRasterOp(int)`, Constant Field Values

### ROP_XOR

    public static final int ROP_XOR

  Raster operation: `DST = SRC ^ DST`.

  Since:
    Java 3D 1.2
  See Also:
    `setRasterOp(int)`, Constant Field Values

Constructor Detail

### 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.0
  visible : true
  ignore vertex colors : false
  raster operation enable : false
  raster operation : ROP_COPY

### 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_COPY or ROP_XOR.
  Since:
    Java 3D 1.2

Method Detail

### 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

### 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:
    `View.setDepthBufferFreezeTransparent(boolean)`

### 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 the alpha test value with each per-pixel alpha 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:
    `View.setVisibilityPolicy(int)`

### 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:
    `ColoringAttributes`, `Material`

### 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:
    `setRasterOp(int)`

### 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_COPY or ROP_XOR
  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_COPY or ROP_XOR.
  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`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD