|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.NodeComponent org.j3d.aviatrix3d.BlendAttributes
public class BlendAttributes
Describes attributes used for blending any drawing primitives.
The default blending mode is set up to mimic the defaults used by OpenGL. However, this class should only be used when the GL_ARB_imaging subset is available. This code automatically checks for it's existance and will disable calling itself if it detects the lack of existance.
Note: If you have semi-transparent objects that need blending, you do not need to provide an instance of this class. Aviatrix3D will internally handle the correct settings that you need, so there is no need to provide your own. Only use this when you want to blend objects with something different than the standard blending setup for non-transparent and transparent objects as it will remove this object from the normal transparency sorting processing and into a separate state.
Default Values
When intialised, this class follows the default OpenGL values for blending:
Blend Equation: EQ_FUNC_ADD RGB Source Mode: BLEND_SRC_COLOR RGB Dest Mode: BLEND_ONE_MINUS_SRC_COLOR Alpha Source Mode: BLEND_SRC_ALPHA Alpha Dest Mode: BLEND_ONE_MINUS_SRC_ALPHA Separated Blend: false Blend colour not set
Internationalisation Resource Names
Field Summary | |
---|---|
static int |
BLEND_CONSTANT_ALPHA
Set the blend factor to use the provided constant alpha value.The constant colour value is provide through the setBlendColour() method. |
static int |
BLEND_CONSTANT_COLOR
Set the blend factor to use the provided constant colour. |
static int |
BLEND_DEST_ALPHA
Set the blend factor to use the destination object's alpha value |
static int |
BLEND_DEST_COLOR
Set the blend factor to use the destination object colour |
static int |
BLEND_ONE
Set the blend factor to ones. |
static int |
BLEND_ONE_MINUS_CONSTANT_ALPHA
Set the blend factor to use one minus the constant colour alpha value (1-c). |
static int |
BLEND_ONE_MINUS_CONSTANT_COLOR
Set the blend factor to use one minus the constant colour (1-c). |
static int |
BLEND_ONE_MINUS_DEST_ALPHA
Set the blend factor to use one minus the destination object alpha value (1-dest). |
static int |
BLEND_ONE_MINUS_DEST_COLOR
Set the blend factor to use one minus the destination object colour (1-dest). |
static int |
BLEND_ONE_MINUS_SRC_ALPHA
Set the blend factor to use one minus source object alpha value (1-src). |
static int |
BLEND_ONE_MINUS_SRC_COLOR
Set the blend factor to use one minus source object colour (1-src). |
static int |
BLEND_SRC_ALPHA
Set the blend factor to use the source object's alpha value |
static int |
BLEND_SRC_ALPHA_SATURATE
Set the blend function to saturage the colour value using the alpha state. |
static int |
BLEND_SRC_COLOR
Set the blend factor to use the source object colour |
static int |
BLEND_ZERO
Set the blend factor to zeros. |
static int |
EQ_FUNC_ADD
Set the blending equation to be CsS + CdD |
static int |
EQ_FUNC_MAX
Set the blending equation to be max(CdD, CsS) |
static int |
EQ_FUNC_MIN
Set the blending equation to be min(CdD, CsS) |
static int |
EQ_FUNC_SUBTRACT
Set the blending equation to be CsS - CdD |
static int |
EQ_FUNC_SUBTRACT_REVERSE
Set the blending equation to be CdD - CsS |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
lastParent, liveCount, parentList |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.rendering.AppearanceAttributeRenderable |
---|
ALPHA_ATTRIBUTE, BLEND_ATTRIBUTE, DEPTH_ATTRIBUTE, LINE_ATTRIBUTE, POINT_ATTRIBUTE, POLYGON_ATTRIBUTE, STENCIL_ATTRIBUTE |
Constructor Summary | |
---|---|
BlendAttributes()
Constructs a attribute set with default values as specified above. |
Method Summary | |
---|---|
int |
compareTo(BlendAttributes ba)
Compares this object with the specified object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(BlendAttributes ba)
Compares this object with the specified object to check for equivalence. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
int |
getAlphaDestinationBlendFactor()
Request the currently set destination blend factor for the alpha component. |
int |
getAlphaSourceBlendFactor()
Request the currently set source blend factor for the alpha component. |
int |
getAttributeType()
Get the type this visual attribute represents. |
void |
getBlendColor(float[] col)
Get the current blend colour. |
int |
getBlendEquation()
Request the currently set blend equation |
int |
getDestinationBlendFactor()
Request the currently set destination blend factor. |
boolean |
getSeparatedBlendFactors()
Check to see the current state of whether separated blending is used or not. |
int |
getSourceBlendFactor()
Request the currently set source blend factor. |
boolean |
isBlendingAvailable()
Check to see if the code has detected the lack of the imaging subset. |
void |
postRender(javax.media.opengl.GL gl)
Restore all openGL state to the given drawable. |
void |
render(javax.media.opengl.GL gl)
Issue ogl commands needed for this component |
void |
setAlphaDestinationBlendFactor(int factor)
Set the destination blend factor to use. |
void |
setAlphaSourceBlendFactor(int factor)
Set the source blend factor to use. |
void |
setBlendColor(float r,
float g,
float b,
float a)
Set the blend colour to use for this texture. |
void |
setBlendEquation(int mode)
Set the blend equation to use. |
void |
setDestinationBlendFactor(int factor)
Set the destination blend factor to use. |
void |
setSeparatedBlendFactors(boolean state)
Instruct the system whether to use separated RGB and Alpha blending functions. |
void |
setSourceBlendFactor(int factor)
Set the source blend factor to use. |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BLEND_ZERO
public static final int BLEND_ONE
public static final int BLEND_SRC_COLOR
public static final int BLEND_ONE_MINUS_SRC_COLOR
public static final int BLEND_DEST_COLOR
public static final int BLEND_ONE_MINUS_DEST_COLOR
public static final int BLEND_SRC_ALPHA
public static final int BLEND_ONE_MINUS_SRC_ALPHA
public static final int BLEND_DEST_ALPHA
public static final int BLEND_ONE_MINUS_DEST_ALPHA
public static final int BLEND_CONSTANT_COLOR
public static final int BLEND_ONE_MINUS_CONSTANT_COLOR
public static final int BLEND_CONSTANT_ALPHA
public static final int BLEND_ONE_MINUS_CONSTANT_ALPHA
public static final int BLEND_SRC_ALPHA_SATURATE
public static final int EQ_FUNC_ADD
public static final int EQ_FUNC_SUBTRACT
public static final int EQ_FUNC_SUBTRACT_REVERSE
public static final int EQ_FUNC_MIN
public static final int EQ_FUNC_MAX
Constructor Detail |
---|
public BlendAttributes()
Method Detail |
---|
public int getAttributeType()
getAttributeType
in interface AppearanceAttributeRenderable
public void render(javax.media.opengl.GL gl)
render
in interface ObjectRenderable
gl
- The gl context to draw withpublic void postRender(javax.media.opengl.GL gl)
postRender
in interface ObjectRenderable
gl
- The gl context to draw withpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public void setSourceBlendFactor(int factor) throws InvalidWriteTimingException
factor
- The value to set for the factor
java.lang.IllegalArgumentException
- The blend factor is not one of the
permitted types
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getSourceBlendFactor()
public void setDestinationBlendFactor(int factor) throws InvalidWriteTimingException
factor
- The value to set for the factor
java.lang.IllegalArgumentException
- The blend factor is not one of the
permitted types or is SRC_ALPHA_SATURATED
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getDestinationBlendFactor()
public void setAlphaSourceBlendFactor(int factor) throws InvalidWriteTimingException
factor
- The value to set for the factor
java.lang.IllegalArgumentException
- The blend factor is not one of the
permitted types
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getAlphaSourceBlendFactor()
public void setAlphaDestinationBlendFactor(int factor) throws InvalidWriteTimingException
factor
- The value to set for the factor
java.lang.IllegalArgumentException
- The blend factor is not one of the
permitted types or is SRC_ALPHA_SATURATED
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getAlphaDestinationBlendFactor()
public void setSeparatedBlendFactors(boolean state) throws InvalidWriteTimingException
state
- True to enable the use of separate RGB and alpha blending
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setBlendEquation(int mode)
EQ_FUNC_ADD: Set the blending equation to be CsS + CdD EQ_FUNC_SUBTRACT: Set the blending equation to be CsS - CdD EQ_FUNC_SUBTRACT_REVERSE: Set the blending equation to be CdD - CsS EQ_FUNC_MIN: Set the blending equation to be min(CdD, CsS) EQ_FUNC_MAX: Set the blending equation to be max(CdD, CsS)
mode
- Blending equation mode
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getBlendEquation()
public boolean getSeparatedBlendFactors()
public void setBlendColor(float r, float g, float b, float a) throws InvalidWriteTimingException
r
- The red component of the blend colourg
- The green component of the blend colourb
- The blue component of the blend coloura
- The alpha component of the blend colour
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void getBlendColor(float[] col)
col
- An array to copy the colour in, in RGBA formatpublic int compareTo(BlendAttributes ba)
ba
- The attributes instance to be compared
public boolean equals(BlendAttributes ba)
ba
- The attributes instance to be compared
public boolean isBlendingAvailable()
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |