/** * Set alpha test value used by alpha test function. This value is * compared to the alpha value of each rendered pixel. * @param value the alpha test value * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setAlphaTestValue(float value){ if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_ALPHA_TEST_VALUE_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes4")); if (isLive()) ((RenderingAttributesRetained)this.retained).setAlphaTestValue(value); else ((RenderingAttributesRetained)this.retained).initAlphaTestValue(value); }
/** * 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. * @param function the new alpha test function. One of * ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, * GREATER_OR_EQUAL * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setAlphaTestFunction(int function){ if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_ALPHA_TEST_FUNCTION_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes6")); if (isLive()) ((RenderingAttributesRetained)this.retained).setAlphaTestFunction(function); else ((RenderingAttributesRetained)this.retained).initAlphaTestFunction(function); }
/** * 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. * @param state true or false to enable or disable depth buffer Write mode * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * @see View#setDepthBufferFreezeTransparent */ public void setDepthBufferWriteEnable(boolean state) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_DEPTH_ENABLE_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes2")); if (isLive()) ((RenderingAttributesRetained)this.retained).setDepthBufferWriteEnable(state); else ((RenderingAttributesRetained)this.retained).initDepthBufferWriteEnable(state); }
/** * Enables or disables depth buffer mode for this RenderingAttributes * component object. * * @param state true or false to enable or disable depth buffer mode * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see GraphicsConfigTemplate3D#setDepthSize */ public void setDepthBufferEnable(boolean state){ if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_DEPTH_ENABLE_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes0")); if (isLive()) ((RenderingAttributesRetained)this.retained).setDepthBufferEnable(state); else ((RenderingAttributesRetained)this.retained).initDepthBufferEnable(state); }
/** * 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. * @param visible true or false to enable or disable visibility * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see View#setVisibilityPolicy * * @since Java 3D 1.2 */ public void setVisible(boolean visible) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_VISIBLE_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes8")); if (isLive()) ((RenderingAttributesRetained)this.retained).setVisible(visible); else ((RenderingAttributesRetained)this.retained).initVisible(visible); }
/** * Sets the raster operation function for this RenderingAttributes * component object. * * @param 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. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.2 */ public void setRasterOp(int rasterOp) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_RASTER_OP_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes10")); if (isLive()) ((RenderingAttributesRetained)this.retained).setRasterOp(rasterOp); else ((RenderingAttributesRetained)this.retained).initRasterOp(rasterOp); }
/** * Sets the stencil write mask for this RenderingAttributes * object. This mask controls which bits of the * stencil buffer are written. * The default value is <code>~0</code> (all ones). * * @param mask the new stencil write mask. * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.4 */ public void setStencilWriteMask(int mask) { if (isLiveOrCompiled()) { if (!this.getCapability(ALLOW_STENCIL_ATTRIBUTES_WRITE)) { throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes16")); } } if (isLive()) ((RenderingAttributesRetained)this.retained).setStencilWriteMask(mask); else ((RenderingAttributesRetained)this.retained).initStencilWriteMask(mask); }
/** * 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. * @param 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. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @since Java 3D 1.4 */ public void setDepthTestFunction(int function){ if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_DEPTH_TEST_FUNCTION_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes14")); if (isLive()) ((RenderingAttributesRetained)this.retained).setDepthTestFunction(function); else ((RenderingAttributesRetained)this.retained).initDepthTestFunction(function); }
/** * 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. * * @param rasterOpEnable true or false to enable or disable * raster operations * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see #setRasterOp * * @since Java 3D 1.2 */ public void setRasterOpEnable(boolean rasterOpEnable) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_RASTER_OP_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes10")); if (isLive()) ((RenderingAttributesRetained)this.retained).setRasterOpEnable(rasterOpEnable); else ((RenderingAttributesRetained)this.retained).initRasterOpEnable(rasterOpEnable); }
/** * 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. * * @param 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. * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see GraphicsConfigTemplate3D#setStencilSize * * @since Java 3D 1.4 */ public void setStencilEnable(boolean state) { if (isLiveOrCompiled()) { if (!this.getCapability(ALLOW_STENCIL_ATTRIBUTES_WRITE)) { throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes16")); } } if (isLive()) ((RenderingAttributesRetained)this.retained).setStencilEnable(state); else ((RenderingAttributesRetained)this.retained).initStencilEnable(state); }
if (isLive()) ((RenderingAttributesRetained)this.retained).setIgnoreVertexColors(ignoreVertexColors); else
if (isLive()) ((RenderingAttributesRetained)this.retained).setStencilOp(stencilOps[0], stencilOps[1],
if (isLive()) ((RenderingAttributesRetained)this.retained).setStencilFunction(params[0], params[1],
if (isLive()) ((RenderingAttributesRetained)this.retained).setStencilOp(failOp, zFailOp,
if (isLive()) ((RenderingAttributesRetained)this.retained).setStencilFunction(function, refValue,