|
||||||||||
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.BlendState
public abstract class BlendState
BlendState
maintains the state of the blending values of a
particular node and its children. The blend state provides a method for
blending a source pixel with a destination pixel. The blend 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.
Nested Class Summary | |
---|---|
static class |
BlendState.BlendEquation
|
static class |
BlendState.DestinationFunction
|
static class |
BlendState.SourceFunction
|
static class |
BlendState.TestFunction
|
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState |
---|
RenderState.StateType |
Field Summary | |
---|---|
protected static boolean |
supportsConstantColor
|
protected static boolean |
supportsEq
|
protected static boolean |
supportsMinMax
|
protected static boolean |
supportsSeparateEq
|
protected static boolean |
supportsSeparateFunc
|
protected static boolean |
supportsSubtract
|
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 | |
---|---|
BlendState()
Constructor instantiates a new BlendState object with
default values. |
Method Summary | |
---|---|
BlendState.BlendEquation |
getBlendEquationAlpha()
|
BlendState.BlendEquation |
getBlendEquationRGB()
|
java.lang.Class<?> |
getClassTag()
|
ColorRGBA |
getConstantColor()
|
BlendState.DestinationFunction |
getDestinationFunctionAlpha()
getDestinationFunction returns the destination function
for the blending function. |
BlendState.DestinationFunction |
getDestinationFunctionRGB()
getDestinationFunction returns the destination function
for the blending function. |
float |
getReference()
getReference returns the reference value that incoming
alpha values are compared to. |
BlendState.SourceFunction |
getSourceFunctionAlpha()
getSourceFunction returns the source function for the
blending function. |
BlendState.SourceFunction |
getSourceFunctionRGB()
getSourceFunction returns the source function for the
blending function. |
RenderState.StateType |
getStateType()
getStateType returns the type RenderState.StateType.Blend |
BlendState.TestFunction |
getTestFunction()
getTestFunction returns the testing function used for the
alpha testing. |
int |
getType()
Deprecated. As of 2.0, use RenderState.getStateType() instead. |
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 |
read(JMEImporter e)
|
void |
setBlendEnabled(boolean value)
setBlendEnabled sets whether or not blending is enabled. |
void |
setBlendEquation(BlendState.BlendEquation blendEquation)
|
void |
setBlendEquationAlpha(BlendState.BlendEquation blendEquation)
|
void |
setBlendEquationRGB(BlendState.BlendEquation blendEquation)
|
void |
setConstantColor(ColorRGBA constantColor)
|
void |
setDestinationFunction(BlendState.DestinationFunction function)
setDestinationFunction sets the destination function for
the blending equation for both Alpha and RGB values. |
void |
setDestinationFunctionAlpha(BlendState.DestinationFunction function)
setDestinationFunctionAlpha sets the destination function
for the blending equation. |
void |
setDestinationFunctionRGB(BlendState.DestinationFunction function)
setDestinationFunctionRGB sets the destination function
for the blending equation. |
void |
setReference(float reference)
setReference sets the reference value that incoming alpha
values are compared to when doing alpha testing. |
void |
setSourceFunction(BlendState.SourceFunction function)
setSrcFunction sets the source function for the blending
equation for both rgb and alpha values. |
void |
setSourceFunctionAlpha(BlendState.SourceFunction function)
setSourceFunctionAlpha sets the source function for the blending
equation used with alpha values. |
void |
setSourceFunctionRGB(BlendState.SourceFunction function)
setSrcFunction sets the source function for the blending
equation. |
void |
setTestEnabled(boolean value)
setTestEnabled turns alpha testing on and off. |
void |
setTestFunction(BlendState.TestFunction function)
setTestFunction sets the testing function used for the
alpha testing. |
static boolean |
supportsConstantColor()
|
static boolean |
supportsEquation()
|
static boolean |
supportsMinMaxEquations()
|
static boolean |
supportsSeparateEquations()
|
static boolean |
supportsSeparateFunctions()
|
static boolean |
supportsSubtractEquations()
|
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 supportsConstantColor
protected static boolean supportsEq
protected static boolean supportsSeparateEq
protected static boolean supportsSeparateFunc
protected static boolean supportsMinMax
protected static boolean supportsSubtract
Constructor Detail |
---|
public BlendState()
BlendState
object with
default values.
Method Detail |
---|
public int getType()
RenderState.getStateType()
instead.
getType
returns the type of render state this is.
(RS_ALPHA).
getType
in class RenderState
RenderState.getType()
public RenderState.StateType getStateType()
getStateType
returns the type RenderState.StateType.Blend
getStateType
in class RenderState
RenderState.StateType.Blend
RenderState.getStateType()
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 setSourceFunction(BlendState.SourceFunction function)
setSrcFunction
sets the source function for the blending
equation for both rgb and alpha values.
function
- the source function for the blending equation.
java.lang.IllegalArgumentException
- if function is nullpublic void setSourceFunctionRGB(BlendState.SourceFunction function)
setSrcFunction
sets the source function for the blending
equation. If supportsSeparateFunc is false, this value will be used for
RGB and Alpha.
function
- the source function for the blending equation.
java.lang.IllegalArgumentException
- if function is nullpublic void setSourceFunctionAlpha(BlendState.SourceFunction function)
setSourceFunctionAlpha
sets the source function for the blending
equation used with alpha values.
function
- the source function for the blending equation for alpha values.
java.lang.IllegalArgumentException
- if function is nullpublic BlendState.SourceFunction getSourceFunctionRGB()
getSourceFunction
returns the source function for the
blending function.
public BlendState.SourceFunction getSourceFunctionAlpha()
getSourceFunction
returns the source function for the
blending function.
public void setDestinationFunction(BlendState.DestinationFunction function)
setDestinationFunction
sets the destination function for
the blending equation for both Alpha and RGB values.
function
- the destination function for the blending equation.
java.lang.IllegalArgumentException
- if function is nullpublic void setDestinationFunctionRGB(BlendState.DestinationFunction function)
setDestinationFunctionRGB
sets the destination function
for the blending equation. If supportsSeparateFunc is false, this value
will be used for RGB and Alpha.
function
- the destination function for the blending equation for RGB
values.
java.lang.IllegalArgumentException
- if function is nullpublic void setDestinationFunctionAlpha(BlendState.DestinationFunction function)
setDestinationFunctionAlpha
sets the destination function
for the blending equation.
function
- the destination function for the blending equation for Alpha
values.
java.lang.IllegalArgumentException
- if function is nullpublic BlendState.DestinationFunction getDestinationFunctionRGB()
getDestinationFunction
returns the destination function
for the blending function.
public BlendState.DestinationFunction getDestinationFunctionAlpha()
getDestinationFunction
returns the destination function
for the blending function.
public void setBlendEquation(BlendState.BlendEquation blendEquation)
public void setBlendEquationRGB(BlendState.BlendEquation blendEquation)
public void setBlendEquationAlpha(BlendState.BlendEquation blendEquation)
public BlendState.BlendEquation getBlendEquationRGB()
public BlendState.BlendEquation getBlendEquationAlpha()
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(BlendState.TestFunction function)
setTestFunction
sets the testing function used for the
alpha testing. If an invalid value is passed, the default TF_ALWAYS is
used.
function
- the testing function used for the alpha testing.
java.lang.IllegalArgumentException
- if function is nullpublic BlendState.TestFunction 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 when doing alpha testing. This is clamped to [0, 1].
reference
- the reference value that alpha values are compared to.public static boolean supportsConstantColor()
public static boolean supportsSeparateFunctions()
public static boolean supportsEquation()
public static boolean supportsSeparateEquations()
public static boolean supportsMinMaxEquations()
public static boolean supportsSubtractEquations()
public float getReference()
getReference
returns the reference value that incoming
alpha values are compared to.
public ColorRGBA getConstantColor()
public void setConstantColor(ColorRGBA constantColor)
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |