|
|||||||||||
| 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.AlphaState
AlphaState maintains the state of the alpha values of a
particular node and it's children. The alpha state provides a method for
blending a source pixel with a destination pixel. The alpha value provides
a transparent or translucent surfaces. For example, this would allow for
the rendering of green glass. Where you could see all objects behind this
green glass but they would be tinted green.
| Field Summary | |
protected boolean |
blendEnabled
The current value of if blend is enabled. |
static int |
DB_DST_ALPHA
The destination value of the blend function is the destination alpha value. |
static int |
DB_ONE
The destination value of the blend function is all ones. |
static int |
DB_ONE_MINUS_DST_ALPHA
The destination value of the blend function is 1 - the destination alpha value. |
static int |
DB_ONE_MINUS_SRC_ALPHA
The destination value of the blend function is 1 - the source alpha value. |
static int |
DB_ONE_MINUS_SRC_COLOR
The destination value of the blend function is 1 - the source color. |
static int |
DB_SRC_ALPHA
The destination value of the blend function is the source alpha value. |
static int |
DB_SRC_COLOR
The destination value of the blend function is the source color. |
static int |
DB_ZERO
The destination value of the blend function is all zeros. |
protected int |
dstBlend
The current destiantion blend function. |
protected float |
reference
The reference value to which incoming alpha values are compared. |
static int |
SB_DST_COLOR
The source value of the blend function is the distance color. |
static int |
SB_ONE
The source value of the blend function is all ones. |
static int |
SB_ONE_MINUS_DST_COLOR
The source value of the blend function is 1 - the distance color. |
static int |
SB_ONE_MINUS_SRC_ALPHA
The source value of the blend function is 1 - the source alpha value. |
static int |
SB_SRC_ALPHA
The source value of the blend function is the source alpha value. |
static int |
SB_SRC_ALPHA_SATURATE
The source value of the blend function is the minimum of alpha or 1 - alpha. |
static int |
SB_ZERO
The source value of the blend function is all zeros. |
protected int |
srcBlend
The current source blend function. |
protected int |
test
Alpha test value. |
protected boolean |
testEnabled
If enabled, alpha testing done. |
static int |
TF_ALWAYS
Always passes the depth test. |
static int |
TF_EQUAL
Pass the test if this alpha is equal to the reference alpha. |
static int |
TF_GEQUAL
Pass the test if this alpha is greater than or equal to the reference alpha. |
static int |
TF_GREATER
Pass the test if this alpha is greater than the reference alpha. |
static int |
TF_LEQUAL
Pass the test if this alpha is less than or equal to the reference alpha. |
static int |
TF_LESS
Pass the test if this alpha is less than the reference alpha. |
static int |
TF_NEVER
Never passes the depth test. |
static int |
TF_NOTEQUAL
Pass the test if this alpha is not equal to the reference alpha. |
| Fields inherited from class com.jme.scene.state.RenderState |
RS_ALPHA, RS_ATTRIBUTE, RS_CULL, RS_DITHER, 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 | |
AlphaState()
Constructor instantiates a new AlphaState object with
default values. |
|
| Method Summary | |
int |
getDstFunction()
getDstFunction returns the destination function for the
blending function. |
float |
getReference()
getReference returns the reference value that incoming
alpha values are compared to. |
int |
getSrcFunction()
getSrcFunction returns the source function for the
blending function. |
int |
getTestFunction()
getTestFunction returns the testing function used for the
alpha testing. |
int |
getType()
getType returns the type of render state this is. |
boolean |
isBlendEnabled()
isBlendEnabled returns true if blending is turned on,
otherwise false is returned. |
boolean |
isTestEnabled()
isTestEnabled returns true if alpha testing is enabled,
false otherwise. |
void |
setBlendEnabled(boolean value)
setBlendEnabled sets whether or not blending is enabled. |
void |
setDstFunction(int dstFunction)
setDstFunction sets the destination function for the
blending function. |
void |
setReference(float reference)
setReference sets the reference value that incoming
alpha values are compared to. |
void |
setSrcFunction(int srcFunction)
setSrcFunction sets the source function for the blending
function. |
void |
setTestEnabled(boolean value)
setTestEnabled turns alpha testing on and off. |
void |
setTestFunction(int testFunction)
setTestFunction sets the testing function used for the
alpha testing. |
| Methods inherited from class com.jme.scene.state.RenderState |
apply, extract, isEnabled, setEnabled |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SB_ZERO
public static final int SB_ONE
public static final int SB_DST_COLOR
public static final int SB_ONE_MINUS_DST_COLOR
public static final int SB_SRC_ALPHA
public static final int SB_ONE_MINUS_SRC_ALPHA
public static final int SB_SRC_ALPHA_SATURATE
public static final int DB_ZERO
public static final int DB_ONE
public static final int DB_SRC_COLOR
public static final int DB_ONE_MINUS_SRC_COLOR
public static final int DB_SRC_ALPHA
public static final int DB_ONE_MINUS_SRC_ALPHA
public static final int DB_DST_ALPHA
public static final int DB_ONE_MINUS_DST_ALPHA
public static final int TF_NEVER
public static final int TF_LESS
public static final int TF_EQUAL
public static final int TF_LEQUAL
public static final int TF_GREATER
public static final int TF_NOTEQUAL
public static final int TF_GEQUAL
public static final int TF_ALWAYS
protected boolean blendEnabled
protected int srcBlend
protected int dstBlend
protected boolean testEnabled
protected int test
protected float reference
| Constructor Detail |
public AlphaState()
AlphaState object with
default values.
| Method Detail |
public int getType()
getType returns the type of render state this is.
(RS_ALPHA).
getType in class RenderStateRenderState.getType()public boolean isBlendEnabled()
isBlendEnabled returns true if blending is turned on,
otherwise false is returned.
public void setBlendEnabled(boolean value)
setBlendEnabled sets whether or not blending is enabled.
value - true to enable the blending, false to disable it.public void setSrcFunction(int srcFunction)
setSrcFunction sets the source function for the blending
function. If an invalid value is passed, the default SB_SRC_ALPHA is
used.
srcFunction - the source function for the blending equation.public int getSrcFunction()
getSrcFunction returns the source function for the
blending function.
public void setDstFunction(int dstFunction)
setDstFunction sets the destination function for the
blending function. If an invalid value is passed, the default
DB_ONE_MINUS_SRC_ALPHA is used.
dstFunction - the destination function for the blending equation.public int getDstFunction()
getDstFunction returns the destination function for the
blending function.
public boolean isTestEnabled()
isTestEnabled returns true if alpha testing is enabled,
false otherwise.
public void setTestEnabled(boolean value)
setTestEnabled turns alpha testing on and off. True turns
on the testing, while false diables it.
value - true to enabled alpha testing, false to disable it.public void setTestFunction(int testFunction)
setTestFunction sets the testing function used for the
alpha testing. If an invalid value is passed, the default TF_ALWAYS is
used.
testFunction - the testing function used for the alpha testing.public int getTestFunction()
getTestFunction returns the testing function used for the
alpha testing.
public void setReference(float reference)
setReference sets the reference value that incoming
alpha values are compared to. This is clamped to [0, 1].
reference - the reference value that alpha values are compared to.public float getReference()
getReference returns the reference value that incoming
alpha values are compared to.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||