|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.state.RenderState
com.jme.scene.state.StencilState
public abstract class StencilState
The StencilState RenderState allows the user to set the attributes of the stencil buffer of the renderer. The Stenciling is similar to Z-Buffering in that it allows enabling and disabling drawing on a per pixel basis. You can use the stencil plane to mask out portions of the rendering to create special effects, such as outlining or planar shadows. Our stencil state supports setting operations for front and back facing polygons separately. If your card does not support setting faces independantly, the front face values will be used for both sides.
Nested Class Summary | |
---|---|
static class |
StencilState.StencilFunction
|
static class |
StencilState.StencilOperation
|
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState |
---|
RenderState.StateType |
Field Summary | |
---|---|
protected static boolean |
stencilWrapSupport
|
protected static boolean |
twoSidedSupport
|
Fields inherited from class com.jme.scene.state.RenderState |
---|
QUICK_COMPARE, RS_BLEND, RS_CLIP, RS_COLORMASK_STATE, RS_CULL, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER |
Constructor Summary | |
---|---|
StencilState()
|
Method Summary | |
---|---|
java.lang.Class<?> |
getClassTag()
|
RenderState.StateType |
getStateType()
getStateType returns the type RenderState.StateType.Stencil |
int |
getStencilFuncMaskBack()
|
int |
getStencilFuncMaskFront()
|
StencilState.StencilFunction |
getStencilFunctionBack()
|
StencilState.StencilFunction |
getStencilFunctionFront()
|
StencilState.StencilOperation |
getStencilOpFailBack()
|
StencilState.StencilOperation |
getStencilOpFailFront()
|
StencilState.StencilOperation |
getStencilOpZFailBack()
|
StencilState.StencilOperation |
getStencilOpZFailFront()
|
StencilState.StencilOperation |
getStencilOpZPassBack()
|
StencilState.StencilOperation |
getStencilOpZPassFront()
|
int |
getStencilReferenceBack()
|
int |
getStencilReferenceFront()
|
int |
getStencilWriteMaskBack()
|
int |
getStencilWriteMaskFront()
|
int |
getType()
Deprecated. As of 2.0, use RenderState.getStateType() instead. |
boolean |
isUseTwoSided()
|
void |
read(JMEImporter e)
|
void |
setStencilFuncMask(int mask)
Sets the stencil mask to be used during stencil functions for both faces. |
void |
setStencilFuncMaskBack(int mask)
Sets the stencil mask to be used during stencil functions for back faces. |
void |
setStencilFuncMaskFront(int mask)
Sets the stencil mask to be used during stencil functions for front faces. |
void |
setStencilFunction(StencilState.StencilFunction function)
Sets the function that defines if a stencil test passes or not for both faces. |
void |
setStencilFunctionBack(StencilState.StencilFunction function)
Sets the function that defines if a stencil test passes or not for back faces. |
void |
setStencilFunctionFront(StencilState.StencilFunction function)
Sets the function that defines if a stencil test passes or not for front faces. |
void |
setStencilMask(int mask)
Convienence method for setting both types of stencil masks at once for both faces. |
void |
setStencilMaskBack(int mask)
Convienence method for setting both types of stencil masks at once for back faces. |
void |
setStencilMaskFront(int mask)
Convienence method for setting both types of stencil masks at once for front faces. |
void |
setStencilOpFail(StencilState.StencilOperation operation)
Specifies the aciton to take when the stencil test fails for both faces. |
void |
setStencilOpFailBack(StencilState.StencilOperation operation)
Specifies the aciton to take when the stencil test fails for back faces. |
void |
setStencilOpFailFront(StencilState.StencilOperation operation)
Specifies the aciton to take when the stencil test fails for front faces. |
void |
setStencilOpZFail(StencilState.StencilOperation operation)
Specifies stencil action when the stencil test passes, but the depth test fails for both faces. |
void |
setStencilOpZFailBack(StencilState.StencilOperation operation)
Specifies stencil action when the stencil test passes, but the depth test fails. |
void |
setStencilOpZFailFront(StencilState.StencilOperation operation)
Specifies stencil action when the stencil test passes, but the depth test fails for front faces. |
void |
setStencilOpZPass(StencilState.StencilOperation operation)
Specifies stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. |
void |
setStencilOpZPassBack(StencilState.StencilOperation operation)
Specifies stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. |
void |
setStencilOpZPassFront(StencilState.StencilOperation operation)
Specifies stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. |
void |
setStencilReference(int reference)
Sets the stencil reference to be used during the stencil function for both faces. |
void |
setStencilReferenceBack(int reference)
Sets the stencil reference to be used during the stencil function for back faces. |
void |
setStencilReferenceFront(int reference)
Sets the stencil reference to be used during the stencil function for front faces. |
void |
setStencilWriteMask(int mask)
Controls which stencil bitplanes are written for both faces. |
void |
setStencilWriteMaskBack(int mask)
Controls which stencil bitplanes are written for back faces. |
void |
setStencilWriteMaskFront(int mask)
Controls which stencil bitplanes are written for front faces. |
void |
setUseTwoSided(boolean useTwoSided)
|
static boolean |
supportsStencilWrap()
|
static boolean |
supportsTwoSided()
|
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.state.RenderState |
---|
apply, createStateRecord, extract, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static boolean twoSidedSupport
protected static boolean stencilWrapSupport
Constructor Detail |
---|
public StencilState()
Method Detail |
---|
public static boolean supportsTwoSided()
public static boolean supportsStencilWrap()
public int getType()
RenderState.getStateType()
instead.
getType
in class RenderState
RenderState.getType()
public RenderState.StateType getStateType()
getStateType
returns the type RenderState.StateType.Stencil
getStateType
in class RenderState
RenderState.StateType.Stencil
RenderState.getStateType()
public void setStencilFunction(StencilState.StencilFunction function)
function
- The new stencil function for both faces.
java.lang.IllegalArgumentException
- if function is nullpublic void setStencilReference(int reference)
reference
- The new stencil reference for both faces.public void setStencilMask(int mask)
mask
- The new stencil write and func mask for both faces.public void setStencilWriteMask(int mask)
mask
- The new stencil write mask for both faces.public void setStencilFuncMask(int mask)
mask
- The new stencil function mask for both faces.public void setStencilOpFail(StencilState.StencilOperation operation)
operation
- The new stencil operation for both faces.
java.lang.IllegalArgumentException
- if operation is nullpublic void setStencilOpZFail(StencilState.StencilOperation operation)
operation
- The Z test operation to set for both faces.
java.lang.IllegalArgumentException
- if operation is nullpublic void setStencilOpZPass(StencilState.StencilOperation operation)
operation
- The new Z test pass operation to set for both faces.
java.lang.IllegalArgumentException
- if operation is nullpublic void setStencilFunctionFront(StencilState.StencilFunction function)
function
- The new stencil function for front faces.
java.lang.IllegalArgumentException
- if function is nullpublic StencilState.StencilFunction getStencilFunctionFront()
public void setStencilReferenceFront(int reference)
reference
- The new stencil reference for front faces.public int getStencilReferenceFront()
public void setStencilMaskFront(int mask)
mask
- The new stencil write and func mask for front faces.public void setStencilWriteMaskFront(int mask)
mask
- The new stencil write mask for front faces.public int getStencilWriteMaskFront()
public void setStencilFuncMaskFront(int mask)
mask
- The new stencil function mask for front faces.public int getStencilFuncMaskFront()
public void setStencilOpFailFront(StencilState.StencilOperation operation)
operation
- The new stencil operation for front faces.
java.lang.IllegalArgumentException
- if operation is nullpublic StencilState.StencilOperation getStencilOpFailFront()
public void setStencilOpZFailFront(StencilState.StencilOperation operation)
operation
- The Z test operation to set for front faces.
java.lang.IllegalArgumentException
- if operation is nullpublic StencilState.StencilOperation getStencilOpZFailFront()
public void setStencilOpZPassFront(StencilState.StencilOperation operation)
operation
- The new Z test pass operation to set for front faces.
java.lang.IllegalArgumentException
- if operation is nullpublic StencilState.StencilOperation getStencilOpZPassFront()
public void setStencilFunctionBack(StencilState.StencilFunction function)
function
- The new stencil function for back faces.
java.lang.IllegalArgumentException
- if function is nullpublic StencilState.StencilFunction getStencilFunctionBack()
public void setStencilReferenceBack(int reference)
reference
- The new stencil reference for back faces.public int getStencilReferenceBack()
public void setStencilMaskBack(int mask)
mask
- The new stencil write and func mask for back faces.public void setStencilWriteMaskBack(int mask)
mask
- The new stencil write mask for back faces.public int getStencilWriteMaskBack()
public void setStencilFuncMaskBack(int mask)
mask
- The new stencil function mask for back faces.public int getStencilFuncMaskBack()
public void setStencilOpFailBack(StencilState.StencilOperation operation)
operation
- The new stencil operation for back faces.
java.lang.IllegalArgumentException
- if operation is nullpublic StencilState.StencilOperation getStencilOpFailBack()
public void setStencilOpZFailBack(StencilState.StencilOperation operation)
operation
- The Z test operation to set for back faces.
java.lang.IllegalArgumentException
- if operation is nullpublic StencilState.StencilOperation getStencilOpZFailBack()
public void setStencilOpZPassBack(StencilState.StencilOperation operation)
operation
- The new Z test pass operation to set for back faces.
java.lang.IllegalArgumentException
- if operation is nullpublic StencilState.StencilOperation getStencilOpZPassBack()
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class RenderState
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class RenderState
java.io.IOException
public java.lang.Class<?> getClassTag()
getClassTag
in interface Savable
getClassTag
in class RenderState
public boolean isUseTwoSided()
public void setUseTwoSided(boolean useTwoSided)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |