Package 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:- 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 thesetRasterOpEnable
method. The raster operation is one of the following: - ROP_CLEAR - DST = 0.
- ROP_AND DST = SRC & DST.
- ROP_AND_REVERSE DST = SRC & ~DST.
- ROP_COPY - DST = SRC. This is the default operation.
- ROP_AND_INVERTED - DST = ~SRC & 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 & 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. ThesetDepthBufferWriteEnable
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 bysetStencilFunction
. - 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:
Appearance
- 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
-
-
Field Summary
Fields Modifier and Type Field Description 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_DEPTH_TEST_FUNCTION_READ
Specifies that this RenderingAttributes object allows reading its depth test function component information.static int
ALLOW_DEPTH_TEST_FUNCTION_WRITE
Specifies that this RenderingAttributes object allows writing its depth test function 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_STENCIL_ATTRIBUTES_READ
Specifies that this RenderingAttributes object allows reading its stencil enable, stencil op, stencil function, and stencil write mask information.static int
ALLOW_STENCIL_ATTRIBUTES_WRITE
Specifies that this RenderingAttributes object allows writing its stencil enable, stencil op, stencil function, and stencil write mask 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
Specifies that pixels are always drawn irrespective of the values being tested.static int
EQUAL
Specifies that pixels are drawn if the two values being tested are equal.static int
GREATER
Specifies that pixels are drawn if the source/reference value is greater than the destination/test value.static int
GREATER_OR_EQUAL
Specifies that pixels are drawn if the source/reference value is greater than or equal to the destination/test value.static int
LESS
Specifies that pixels are drawn if the source/reference value is less than the destination/test value.static int
LESS_OR_EQUAL
Specifies that pixels are drawn if the source/reference value is less than or equal to the destination/test value.static int
NEVER
Specifies that pixels are never drawn irrespective of the values being tested.static int
NOT_EQUAL
Specifies that pixels are drawn if the two values being tested are not equal.static int
ROP_AND
Raster operation:DST = SRC & DST
.static int
ROP_AND_INVERTED
Raster operation:DST = ~SRC & DST
.static int
ROP_AND_REVERSE
Raster operation:DST = SRC & ~DST
.static int
ROP_CLEAR
Raster operation:DST = 0
.static int
ROP_COPY
Raster operation:DST = SRC
.static int
ROP_COPY_INVERTED
Raster operation:DST = ~SRC
.static int
ROP_EQUIV
Raster operation:DST = ~( DST ^ SRC )
.static int
ROP_INVERT
Raster operation:DST = ~DST
.static int
ROP_NAND
Raster operation:DST = ~(SRC & DST)
.static int
ROP_NOOP
Raster operation:DST = DST
.static int
ROP_NOR
Raster operation:DST = ~( DST | SRC )
.static int
ROP_OR
Raster operation:DST = DST | SRC
.static int
ROP_OR_INVERTED
Raster operation:DST = ~SRC | DST
.static int
ROP_OR_REVERSE
Raster operation:DST = src | ~DST
.static int
ROP_SET
Raster operation:DST = 1
.static int
ROP_XOR
Raster operation:DST = SRC ^ DST
.static int
STENCIL_DECR
Stencil operation:DST = DST - 1
static int
STENCIL_INCR
Stencil operation:DST = DST + 1
static int
STENCIL_INVERT
Stencil operation:DST = ~DST
static int
STENCIL_KEEP
Stencil operation:DST = DST
static int
STENCIL_REPLACE
Stencil operation:DST = REF
static int
STENCIL_ZERO
Stencil operation:DST = 0
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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 flagboolean
getDepthBufferWriteEnable()
Retrieves the state of Depth Buffer Write Enable flag.int
getDepthTestFunction()
Retrieves current depth test function.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
getStencilEnable()
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
getStencilWriteMask()
Retrieves the current stencil write mask 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
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
setStencilWriteMask(int mask)
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 javax.media.j3d.NodeComponent
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
-
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
-
-
-
-
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_TEST_FUNCTION_READ
public static final int ALLOW_DEPTH_TEST_FUNCTION_READ
Specifies that this RenderingAttributes object allows reading its depth test function component information.- Since:
- Java 3D 1.4
- See Also:
- Constant Field Values
-
ALLOW_DEPTH_TEST_FUNCTION_WRITE
public static final int ALLOW_DEPTH_TEST_FUNCTION_WRITE
Specifies that this RenderingAttributes object allows writing its depth test function component information.- Since:
- Java 3D 1.4
- 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
-
ALLOW_STENCIL_ATTRIBUTES_READ
public static final int ALLOW_STENCIL_ATTRIBUTES_READ
Specifies that this RenderingAttributes object allows reading its stencil enable, stencil op, stencil function, and stencil write mask information.- Since:
- Java 3D 1.4
- See Also:
- Constant Field Values
-
ALLOW_STENCIL_ATTRIBUTES_WRITE
public static final int ALLOW_STENCIL_ATTRIBUTES_WRITE
Specifies that this RenderingAttributes object allows writing its stencil enable, stencil op, stencil function, and stencil write mask information.- Since:
- Java 3D 1.4
- See Also:
- Constant Field Values
-
ALWAYS
@Native public static final int ALWAYS
Specifies that pixels are always drawn irrespective of the values being tested. Can be used to specify the alpha test function, the depth test function, or the stencil function. This setting effectively disables alpha, depth, or stencil testing.
-
NEVER
@Native public static final int NEVER
Specifies that pixels are never drawn irrespective of the values being tested. Can be used to specify the alpha test function, the depth test function, or the stencil function.
-
EQUAL
@Native public static final int EQUAL
Specifies that pixels are drawn if the two values being tested are equal. Can be used to specify the alpha test function, the depth test function, or the stencil function.
-
NOT_EQUAL
@Native public static final int NOT_EQUAL
Specifies that pixels are drawn if the two values being tested are not equal. Can be used to specify the alpha test function, the depth test function, or the stencil function.
-
LESS
@Native public static final int LESS
Specifies that pixels are drawn if the source/reference value is less than the destination/test value. Can be used to specify the alpha test function, the depth test function, or the stencil function.
-
LESS_OR_EQUAL
@Native public static final int LESS_OR_EQUAL
Specifies that pixels are drawn if the source/reference value is less than or equal to the destination/test value. Can be used to specify the alpha test function, the depth test function, or the stencil function.
-
GREATER
@Native public static final int GREATER
Specifies that pixels are drawn if the source/reference value is greater than the destination/test value. Can be used to specify the alpha test function, the depth test function, or the stencil function.
-
GREATER_OR_EQUAL
@Native public static final int GREATER_OR_EQUAL
Specifies that pixels are drawn if the source/reference value is greater than or equal to the destination/test value. Can be used to specify the alpha test function, the depth test function, or the stencil function.
-
ROP_CLEAR
@Native public static final int ROP_CLEAR
Raster operation:DST = 0
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_AND
@Native public static final int ROP_AND
Raster operation:DST = SRC & DST
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_AND_REVERSE
@Native public static final int ROP_AND_REVERSE
Raster operation:DST = SRC & ~DST
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_COPY
@Native public static final int ROP_COPY
Raster operation:DST = SRC
.- Since:
- Java 3D 1.2
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_AND_INVERTED
@Native public static final int ROP_AND_INVERTED
Raster operation:DST = ~SRC & DST
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_NOOP
@Native public static final int ROP_NOOP
Raster operation:DST = DST
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_XOR
@Native public static final int ROP_XOR
Raster operation:DST = SRC ^ DST
.- Since:
- Java 3D 1.2
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_OR
@Native public static final int ROP_OR
Raster operation:DST = DST | SRC
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_NOR
@Native public static final int ROP_NOR
Raster operation:DST = ~( DST | SRC )
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_EQUIV
@Native public static final int ROP_EQUIV
Raster operation:DST = ~( DST ^ SRC )
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_INVERT
@Native public static final int ROP_INVERT
Raster operation:DST = ~DST
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_OR_REVERSE
@Native public static final int ROP_OR_REVERSE
Raster operation:DST = src | ~DST
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_COPY_INVERTED
@Native public static final int ROP_COPY_INVERTED
Raster operation:DST = ~SRC
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_OR_INVERTED
@Native public static final int ROP_OR_INVERTED
Raster operation:DST = ~SRC | DST
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_NAND
@Native public static final int ROP_NAND
Raster operation:DST = ~(SRC & DST)
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
ROP_SET
@Native public static final int ROP_SET
Raster operation:DST = 1
.- Since:
- Java 3D 1.4
- See Also:
setRasterOp(int)
, Constant Field Values
-
STENCIL_KEEP
@Native public static final int STENCIL_KEEP
Stencil operation:DST = DST
- Since:
- Java 3D 1.4
- See Also:
setStencilOp(int,int,int)
, Constant Field Values
-
STENCIL_ZERO
@Native public static final int STENCIL_ZERO
Stencil operation:DST = 0
- Since:
- Java 3D 1.4
- See Also:
setStencilOp(int,int,int)
, Constant Field Values
-
STENCIL_REPLACE
@Native public static final int STENCIL_REPLACE
Stencil operation:DST = REF
- Since:
- Java 3D 1.4
- See Also:
setStencilOp(int,int,int)
, Constant Field Values
-
STENCIL_INCR
@Native public static final int STENCIL_INCR
Stencil operation:DST = DST + 1
- Since:
- Java 3D 1.4
- See Also:
setStencilOp(int,int,int)
, Constant Field Values
-
STENCIL_DECR
@Native public static final int STENCIL_DECR
Stencil operation:DST = DST - 1
- Since:
- Java 3D 1.4
- See Also:
setStencilOp(int,int,int)
, Constant Field Values
-
STENCIL_INVERT
@Native public static final int STENCIL_INVERT
Stencil operation:DST = ~DST
- Since:
- Java 3D 1.4
- See Also:
setStencilOp(int,int,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.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/offdepthBufferWriteEnable
- a flag to to make depth buffer read/write or read onlyalphaTestValue
- the alpha test reference valuealphaTestFunction
- 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/offdepthBufferWriteEnable
- a flag to make depth buffer read/write or read onlyalphaTestValue
- the alpha test reference valuealphaTestFunction
- the function for comparing alpha valuesvisible
- a flag that specifies whether the object is visibleignoreVertexColors
- a flag to enable or disable the ignoring of per-vertex colorsrasterOpEnable
- 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 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- See Also:
GraphicsConfigTemplate3D.setDepthSize(int)
-
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 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:
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. IfignoreVertexColors
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). IfignoreVertexColors
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_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 classNodeComponent
-
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:
GraphicsConfigTemplate3D.setStencilSize(int)
-
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 thefailOp
parameter, element 1 specifies thezFailOp
parameter, and element 2 specifies thezPassOp
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:
setStencilOp(int,int,int)
-
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. ThefailOp
parameter is copied into element 0 of the array, thezFailOp
parameter is copied into element 1, and thezPassOp
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 valuecompareMask
- 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:
setStencilFunction(int,int,int)
-
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
-
-