|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.NodeComponent
org.j3d.aviatrix3d.TextureAttributes
Describes how a texture gets applied to the underlying geometry.
All of these attributes are part of the texture object so we only issue OGL commands when they change. This will update the Texture Object's values for all future uses.
When providing texture unit identfiers for the source for the combiner functions, not all the constants are defined. Since OpenGL uses sequential numbering, if you need anything greater than 8, you can specify the value buy making the call with SOURCE_TEXUTRE_0 + n where n is the texture unit ID that you want to use.
Field Summary | |
static int |
COMBINE_ADD
Set combine mode for applying textures to objects to GL_ADD |
static int |
COMBINE_ADD_SIGNED
Set combine mode for applying textures to objects to GL_ADD_SIGNED |
static int |
COMBINE_DOT3_RGB
Set combine mode for applying textures to objects to GL_DOT3_RGB |
static int |
COMBINE_DOT3_RGBA
Set combine mode for applying textures to objects to GL_DOT3_RGBA |
static int |
COMBINE_INTERPOLATE
Set combine mode for applying textures to objects to GL_INTERPOLATE |
static int |
COMBINE_MODULATE
Set combine mode for applying textures to objects to GL_MODULATE |
static int |
COMBINE_REPLACE
Set combine mode for applying textures to objects to GL_REPLACE |
static int |
COMBINE_SUBTRACT
Set combine mode for applying textures to objects to GL_SUBTRACT |
static int |
MODE_ADD
Set the mode for applying textures to objects to GL_ADD |
static int |
MODE_BLEND
Set the mode for applying textures to objects to GL_BLEND |
static int |
MODE_COMBINE
Set the mode for applying textures to objects to GL_COMBINE |
static int |
MODE_DECAL
Set the mode for applying textures to objects to GL_DECAL |
static int |
MODE_MODULATE
Set the mode for applying textures to objects to GL_MODULATE |
static int |
MODE_REPLACE
Set the mode for applying textures to objects to GL_REPLACE |
static int |
ONE_MINUS_SRC_ALPHA
Use one minus source alpha for the incoming operation |
static int |
ONE_MINUS_SRC_COLOR
Use one minus source colour for the incoming operation |
static int |
SOURCE_BASE_COLOR
The source is the base colour of the object before texturing has been applied. |
static int |
SOURCE_CONSTANT_COLOR
The source is the provided texture blend colour |
static int |
SOURCE_CURRENT_TEXTURE
The source is the current texture stage |
static int |
SOURCE_PREVIOUS_UNIT
The source is the output of the previous texture unit |
static int |
SOURCE_TEXTURE_0
The source is texture stage 0 |
static int |
SOURCE_TEXTURE_1
The source is texture stage 1 |
static int |
SOURCE_TEXTURE_2
The source is texture stage 2 |
static int |
SOURCE_TEXTURE_3
The source is texture stage 3 |
static int |
SOURCE_TEXTURE_4
The source is texture stage 4 |
static int |
SOURCE_TEXTURE_5
The source is texture stage 5 |
static int |
SOURCE_TEXTURE_6
The source is texture stage 6 |
static int |
SOURCE_TEXTURE_7
The source is texture stage 7 |
static int |
SRC_ALPHA
Use the source alpha for the incoming operation |
static int |
SRC_COLOR
Use the source colour for the incoming operation |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
liveCount |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, updateHandler, WRITE_TIMING_MSG |
Constructor Summary | |
TextureAttributes()
Constructs a Texture Unit with default values. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
int |
compareTo(TextureAttributes ta)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
boolean |
equals(TextureAttributes ta)
Compares this object with the specified object to check for equivalence. |
void |
getBlendColor(float[] col)
Get the current blend colour. |
int |
getCombineMode(boolean alpha)
Get the combine mode in use. |
int |
getCombineOperand(boolean alpha,
int opIdx)
Get the current value of the combine operand in use. |
float |
getCombineScale(boolean alpha)
Get the combine scale factor. |
int |
getCombineSource(boolean alpha,
int opIdx)
Get the current value of the combine source function in use |
int |
getTextureMode()
Get the current texture mode in use. |
void |
renderState(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Issue ogl commands needed for this component |
void |
restoreState(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Restore all openGL state to the given drawable. |
void |
setBlendColor(float r,
float g,
float b,
float a)
Set the blend colour to use for this texture. |
void |
setCombineMode(boolean alpha,
int mode)
Set the combine mode for the alpha or RGB side. |
void |
setCombineOperand(boolean alpha,
int opIdx,
int function)
Set the operand to use for alpha or RGB combine mode. |
void |
setCombineScale(boolean alpha,
float scale)
Set the combine scale factor. |
void |
setCombineSource(boolean alpha,
int opIdx,
int source)
Set the combine source type for alpha or RGB combine mode. |
void |
setTextureMode(int mode)
Set the texture mode. |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
addParent, getParents, hasChanged, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicChild, checkForCyclicParent, dataChanged, 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 MODE_REPLACE
public static final int MODE_MODULATE
public static final int MODE_BLEND
public static final int MODE_DECAL
public static final int MODE_ADD
public static final int MODE_COMBINE
public static final int COMBINE_REPLACE
public static final int COMBINE_MODULATE
public static final int COMBINE_ADD
public static final int COMBINE_ADD_SIGNED
public static final int COMBINE_INTERPOLATE
public static final int COMBINE_SUBTRACT
public static final int COMBINE_DOT3_RGB
public static final int COMBINE_DOT3_RGBA
public static final int SOURCE_CURRENT_TEXTURE
public static final int SOURCE_TEXTURE_0
public static final int SOURCE_TEXTURE_1
public static final int SOURCE_TEXTURE_2
public static final int SOURCE_TEXTURE_3
public static final int SOURCE_TEXTURE_4
public static final int SOURCE_TEXTURE_5
public static final int SOURCE_TEXTURE_6
public static final int SOURCE_TEXTURE_7
public static final int SOURCE_CONSTANT_COLOR
public static final int SOURCE_BASE_COLOR
public static final int SOURCE_PREVIOUS_UNIT
public static final int SRC_COLOR
public static final int ONE_MINUS_SRC_COLOR
public static final int SRC_ALPHA
public static final int ONE_MINUS_SRC_ALPHA
Constructor Detail |
public TextureAttributes()
Method Detail |
public void renderState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
renderState
in class NodeComponent
gl
- The gl context to draw withglu
- The utility context to draw withpublic void restoreState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
restoreState
in class NodeComponent
gl
- The gl context to draw withglu
- The utility 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)
o
- The object to be compared
public void setTextureMode(int mode) throws InvalidWriteTimingException
mode
- The new mode
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic int getTextureMode()
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 callback methodpublic void getBlendColor(float[] col)
col
- An array to copy the colour in, in RGBA formatpublic void setCombineMode(boolean alpha, int mode) throws InvalidWriteTimingException
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic int getCombineMode(boolean alpha)
alpha
- true when this should fetch the alpha setting, false for
the RGB setting
public void setCombineScale(boolean alpha, float scale)
alpha
- Scale the alpha channel? Or the Rgb channel.public float getCombineScale(boolean alpha)
alpha
- Scale the alpha channel? Or the Rgb channel.public void setCombineOperand(boolean alpha, int opIdx, int function) throws InvalidWriteTimingException
alpha
- true when this should set the alpha setting, false for
the RGB settingopIdx
- A value of 0, 1 or 2 indicating which operand argument
this should effect
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic int getCombineOperand(boolean alpha, int opIdx)
alpha
- true when this should fetch the alpha setting, false for
the RGB settingopIdx
- A value of 0, 1 or 2 indicating which operand argument
this should fetch
public void setCombineSource(boolean alpha, int opIdx, int source) throws InvalidWriteTimingException
alpha
- true when this should set the alpha setting, false for
the RGB settingopIdx
- A value of 0, 1 or 2 indicating which operand argument
this should effect
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic int getCombineSource(boolean alpha, int opIdx)
alpha
- true when this should fetch the alpha setting, false for
the RGB settingopIdx
- A value of 0, 1 or 2 indicating which operand argument
this should fetch
public int compareTo(TextureAttributes ta)
ta
- The attributes instance to be compared
public boolean equals(TextureAttributes ta)
ta
- The attributes instance to be compared
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |