|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.NodeComponent | +--javax.media.j3d.TextureAttributes
The TextureAttributes object defines attributes that apply to texture mapping. The texture attributes include the following:
C'a = Ca
C'a = Ca Cta
where CNx is the x component of the Nth color operand in the combine operation.
The value C' will be placed to the all three r,g,b components or the a component of the output.
where C0, C1 and C2 are determined by the color source, and the color operand.
Appearance
,
Canvas3D.queryProperties()
Field Summary | |
static int |
ALLOW_BLEND_COLOR_READ
Specifies that this TextureAttributes object allows reading its texture blend color component information. |
static int |
ALLOW_BLEND_COLOR_WRITE
Specifies that this TextureAttributes object allows writing its texture blend color component information. |
static int |
ALLOW_COLOR_TABLE_READ
Specifies that this TextureAttributes object allows reading its texture color table component information. |
static int |
ALLOW_COLOR_TABLE_WRITE
Specifies that this TextureAttributes object allows writing its texture color table component information. |
static int |
ALLOW_COMBINE_READ
Specifies that this TextureAttributes object allows reading its texture combine mode information. |
static int |
ALLOW_COMBINE_WRITE
Specifies that this TextureAttributes object allows writing its texture combine mode information. |
static int |
ALLOW_MODE_READ
Specifies that this TextureAttributes object allows reading its texture mode component information and perspective correction mode. |
static int |
ALLOW_MODE_WRITE
Specifies that this TextureAttributes object allows writing its texture mode component information and perspective correction mode. |
static int |
ALLOW_TRANSFORM_READ
Specifies that this TextureAttributes object allows reading its texture transform component information. |
static int |
ALLOW_TRANSFORM_WRITE
Specifies that this TextureAttributes object allows writing its texture transform component information. |
static int |
BLEND
Blend the texture blend color with the object color. |
static int |
COMBINE
Combine the object color with texture color as specified in the combine mode. |
static int |
COMBINE_ADD
Add two colors. |
static int |
COMBINE_ADD_SIGNED
Add two colors plus an implicit offset. |
static int |
COMBINE_CONSTANT_COLOR
Texture blend color. |
static int |
COMBINE_DOT3
Dot product of two colors. |
static int |
COMBINE_INTERPOLATE
Interpolate two colors with a factor. |
static int |
COMBINE_MODULATE
Modulates one color with another color. |
static int |
COMBINE_OBJECT_COLOR
Object color coming into the texturing state. |
static int |
COMBINE_ONE_MINUS_SRC_ALPHA
Color function is f = (1 - Ca) |
static int |
COMBINE_ONE_MINUS_SRC_COLOR
Color function is f = (1 - Crgb) |
static int |
COMBINE_PREVIOUS_TEXTURE_UNIT_STATE
Color from the previous texture unit state. |
static int |
COMBINE_REPLACE
Replace the input color with the specified color. |
static int |
COMBINE_SRC_ALPHA
Color function is f = Ca |
static int |
COMBINE_SRC_COLOR
Color function is f = Crgb |
static int |
COMBINE_SUBTRACT
Subtract one color from another color. |
static int |
COMBINE_TEXTURE_COLOR
Texture color of the corresponding texture unit state. |
static int |
DECAL
Apply the texture color to the object as a decal. |
static int |
FASTEST
Use the fastest available method for perspective correction. |
static int |
MODULATE
Modulate the object color with the texture color. |
static int |
NICEST
Use the nicest (highest quality) available method for texture mapping perspective correction. |
static int |
REPLACE
Replace the object color with the texture color. |
Constructor Summary | |
TextureAttributes()
Constructs a TextureAttributes object with default parameters. |
|
TextureAttributes(int textureMode,
Transform3D transform,
Color4f textureBlendColor,
int perspCorrectionMode)
Constructs a TextureAttributes object with the specified values. |
Method Summary | |
NodeComponent |
cloneNodeComponent()
Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate) |
int |
getCombineAlphaFunction(int index)
Retrieves the function for the alpha component of the specified color operand for this object. |
int |
getCombineAlphaMode()
Retrieves the combine mode for the alpha component of the output color for this object. |
int |
getCombineAlphaScale()
Retrieves the scale factor for the alpha component of the output color for this object. |
int |
getCombineAlphaSource(int index)
Retrieves the source for the alpha component of the specified color operand for this object. |
int |
getCombineRgbFunction(int index)
Retrieves the function for the rgb components of the specified color operand for this object. |
int |
getCombineRgbMode()
Retrieves the combine mode for the rgb components of the output color for this object. |
int |
getCombineRgbScale()
Retrieves the scale factor for the rgb components of the output color for this object. |
int |
getCombineRgbSource(int index)
Retrieves the source for the rgb components of the specified color operand for this object. |
int |
getNumTextureColorTableComponents()
Retrieves the number of color components in the current texture color table. |
int |
getPerspectiveCorrectionMode()
Gets perspective correction mode value. |
void |
getTextureBlendColor(Color4f textureBlendColor)
Gets the texture blend color for this appearance component object. |
void |
getTextureColorTable(int[][] table)
Retrieves the texture color table and copies it into the specified array. |
int |
getTextureColorTableSize()
Retrieves the size of the current texture color table. |
int |
getTextureMode()
Gets the texture mode parameter for this texture attributes object. |
void |
getTextureTransform(Transform3D transform)
Retrieves a copy of the texture transform object. |
void |
setCombineAlphaFunction(int index,
int function)
Sets the function for the alpha component of the specified color operand for this object. |
void |
setCombineAlphaMode(int combineMode)
Sets the combine mode for the alpha component of the output color for this object. |
void |
setCombineAlphaScale(int scale)
Sets the scale factor for the alpha component of the output color for this object. |
void |
setCombineAlphaSource(int index,
int src)
Sets the source for the alpha component of the specified color operand for this object. |
void |
setCombineRgbFunction(int index,
int function)
Sets the function for the rgb components of the specified color operand for this object. |
void |
setCombineRgbMode(int combineMode)
Sets the combine mode for the rgb components of the output color for this object. |
void |
setCombineRgbScale(int scale)
Sets the scale factor for the rgb components of the output color for this object. |
void |
setCombineRgbSource(int index,
int src)
Sets the source for the rgb components of the specified color operand for this object. |
void |
setPerspectiveCorrectionMode(int mode)
Sets perspective correction mode to be used for color and/or texture coordinate interpolation. |
void |
setTextureBlendColor(Color4f textureBlendColor)
Sets the texture constant color for this texture attributes object. |
void |
setTextureBlendColor(float r,
float g,
float b,
float a)
Sets the texture blend color for this appearance component object. |
void |
setTextureColorTable(int[][] table)
Sets the texture color table from the specified table. |
void |
setTextureMode(int textureMode)
Sets the texture mode parameter for this appearance component object. |
void |
setTextureTransform(Transform3D transform)
Sets the texture transform object used to transform texture coordinates. |
Methods inherited from class javax.media.j3d.NodeComponent |
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData, updateNodeReferences |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALLOW_MODE_READ
public static final int ALLOW_MODE_WRITE
public static final int ALLOW_BLEND_COLOR_READ
public static final int ALLOW_BLEND_COLOR_WRITE
public static final int ALLOW_TRANSFORM_READ
public static final int ALLOW_TRANSFORM_WRITE
public static final int ALLOW_COLOR_TABLE_READ
public static final int ALLOW_COLOR_TABLE_WRITE
public static final int ALLOW_COMBINE_READ
public static final int ALLOW_COMBINE_WRITE
public static final int FASTEST
setPerspectiveCorrectionMode(int)
,
Constant Field Valuespublic static final int NICEST
setPerspectiveCorrectionMode(int)
,
Constant Field Valuespublic static final int MODULATE
setTextureMode(int)
,
Constant Field Valuespublic static final int DECAL
setTextureMode(int)
,
Constant Field Valuespublic static final int BLEND
setTextureMode(int)
,
Constant Field Valuespublic static final int REPLACE
setTextureMode(int)
,
Constant Field Valuespublic static final int COMBINE
setTextureMode(int)
,
Constant Field Valuespublic static final int COMBINE_REPLACE
setCombineRgbMode(int)
,
setCombineAlphaMode(int)
,
Constant Field Valuespublic static final int COMBINE_MODULATE
setCombineRgbMode(int)
,
setCombineAlphaMode(int)
,
Constant Field Valuespublic static final int COMBINE_ADD
setCombineRgbMode(int)
,
setCombineAlphaMode(int)
,
Constant Field Valuespublic static final int COMBINE_ADD_SIGNED
setCombineRgbMode(int)
,
setCombineAlphaMode(int)
,
Constant Field Valuespublic static final int COMBINE_SUBTRACT
setCombineRgbMode(int)
,
setCombineAlphaMode(int)
,
Constant Field Valuespublic static final int COMBINE_INTERPOLATE
setCombineRgbMode(int)
,
setCombineAlphaMode(int)
,
Constant Field Valuespublic static final int COMBINE_DOT3
setCombineRgbMode(int)
,
setCombineAlphaMode(int)
,
Constant Field Valuespublic static final int COMBINE_OBJECT_COLOR
setCombineRgbSource(int, int)
,
setCombineAlphaSource(int, int)
,
Constant Field Valuespublic static final int COMBINE_TEXTURE_COLOR
setCombineRgbSource(int, int)
,
setCombineAlphaSource(int, int)
,
Constant Field Valuespublic static final int COMBINE_CONSTANT_COLOR
setCombineRgbSource(int, int)
,
setCombineAlphaSource(int, int)
,
Constant Field Valuespublic static final int COMBINE_PREVIOUS_TEXTURE_UNIT_STATE
setCombineRgbSource(int, int)
,
setCombineAlphaSource(int, int)
,
Constant Field Valuespublic static final int COMBINE_SRC_COLOR
setCombineRgbFunction(int, int)
,
Constant Field Valuespublic static final int COMBINE_ONE_MINUS_SRC_COLOR
setCombineRgbFunction(int, int)
,
Constant Field Valuespublic static final int COMBINE_SRC_ALPHA
setCombineRgbFunction(int, int)
,
setCombineAlphaFunction(int, int)
,
Constant Field Valuespublic static final int COMBINE_ONE_MINUS_SRC_ALPHA
setCombineRgbFunction(int, int)
,
setCombineAlphaFunction(int, int)
,
Constant Field ValuesConstructor Detail |
public TextureAttributes()
public TextureAttributes(int textureMode, Transform3D transform, Color4f textureBlendColor, int perspCorrectionMode)
textureMode
- the texture mode; one of MODULATE
,
DECAL
, BLEND
, REPLACE
, or
COMBINE
transform
- the transform object, used to transform texture
coordinatestextureBlendColor
- the texture constant colorperspCorrectionMode
- the perspective correction mode to
be used for color and/or texture coordinate interpolation;
one of NICEST
or FASTEST
java.lang.IllegalArgumentException
- if textureMode
is a value other than MODULATE
,
DECAL
, BLEND
, REPLACE
, or
COMBINE
Method Detail |
public void setTextureMode(int textureMode)
textureMode
- the texture mode, one of: MODULATE
,
DECAL
, BLEND
, REPLACE
, or
COMBINE
java.lang.IllegalArgumentException
- if textureMode
is a value other than MODULATE
,
DECAL
, BLEND
, REPLACE
, or
COMBINE
Canvas3D.queryProperties()
public int getTextureMode()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setTextureBlendColor(Color4f textureBlendColor)
textureBlendColor
- the texture constant color
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setTextureBlendColor(float r, float g, float b, float a)
r
- the red component of the colorg
- the green component of the colorb
- the blue component of the colora
- the alpha component of the color
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void getTextureBlendColor(Color4f textureBlendColor)
textureBlendColor
- the vector that will receive the texture
constant color
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setTextureTransform(Transform3D transform)
transform
- the new transform object
CapabilityNotSetException
- if the method is called
when this object is part of live or compiled scene graph.public void getTextureTransform(Transform3D transform)
transform
- the transform object that will receive the
current texture transform
CapabilityNotSetException
- if the method is called
when this object is part of live or compiled scene graph.public void setPerspectiveCorrectionMode(int mode)
NICEST
indicates that perspective correction should be
performed and that the highest quality method should be used.
A value of FASTEST
indicates that the most efficient perspective
correction method should be used.
mode
- one of NICEST
or FASTEST
The default value is NICEST
.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
java.lang.IllegalArgumentException
- if mode value is other
than FASTEST
or NICEST
.public int getPerspectiveCorrectionMode()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setTextureColorTable(int[][] table)
table.length
defines the number of color
components and table[0].length
defines the texture
color table size. If the table is non-null, the number of
color components must either be 3, for rgb data, or 4,
for rgba data. The size of each array for each color
component must be the same and must be a power of 2. If table
is null or if the texture color table size is 0, the texture
color table is disabled. If the texture color table size is
greater than the device-dependent maximum texture color table
size for a particular Canvas3D, the texture color table is
ignored for that canvas.
When enabled, the texture color table is applied after the
texture filtering operation and before texture application.
Each of the r, g, b, and a
components are clamped to the range [0,1], multiplied by
textureColorTableSize-1
, and rounded to the
nearest integer. The resulting value for each component is
then used as an index into the respective table for that
component. If the texture color table contains 3 components,
alpha is passed through unmodified.
table
- the new texture color table
java.lang.IllegalArgumentException
- if table.length
is not 3 or 4, or if the arrays for each component are not all
the same length, or if the texture color table size
is not a power of 2
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public void getTextureColorTable(int[][] table)
table
- the array that will receive a copy of the
texture color table from this TextureAttributes object.
The array must be allocated by the caller and must be large
enough to hold the entire table (that is,
int[numTextureColorTableComponents][textureColorTableSize]
).
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int getNumTextureColorTableComponents()
public int getTextureColorTableSize()
public void setCombineRgbMode(int combineMode)
combineMode
- the combine mode, one of:
COMBINE_REPLACE
,
COMBINE_MODULATE
, COMBINE_ADD
,
COMBINE_ADD_SIGNED
, COMBINE_SUBTRACT
,
COMBINE_INTERPOLATE
, or COMBINE_DOT3
java.lang.IllegalArgumentException
- if combineMode
is a value other than COMBINE_REPLACE
,
COMBINE_MODULATE
, COMBINE_ADD
,
COMBINE_ADD_SIGNED
, COMBINE_SUBTRACT
,
COMBINE_INTERPOLATE
, or COMBINE_DOT3
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public void setCombineAlphaMode(int combineMode)
combineMode
- the combine mode, one of:
COMBINE_REPLACE
,
COMBINE_MODULATE
, COMBINE_ADD
,
COMBINE_ADD_SIGNED
, COMBINE_SUBTRACT
,
COMBINE_INTERPOLATE
, or COMBINE_DOT3
java.lang.IllegalArgumentException
- if combineMode
is a value other than COMBINE_REPLACE
,
COMBINE_MODULATE
, COMBINE_ADD
,
COMBINE_ADD_SIGNED
, COMBINE_SUBTRACT
,
COMBINE_INTERPOLATE
, or COMBINE_DOT3
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public int getCombineRgbMode()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int getCombineAlphaMode()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setCombineRgbSource(int index, int src)
index
- color operand in the combine operationsrc
- the color source, one of: COMBINE_OBJECT_COLOR
,
COMBINE_TEXTURE_COLOR
,
COMBINE_CONSTANT_COLOR
, or
COMBINE_PREVIOUS_TEXTURE_UNIT_STATE
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2
java.lang.IllegalArgumentException
- if src
is a value other than COMBINE_OBJECT_COLOR
,
COMBINE_TEXTURE_COLOR
,
COMBINE_CONSTANT_COLOR
, or
COMBINE_PREVIOUS_TEXTURE_UNIT_STATE
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public void setCombineAlphaSource(int index, int src)
index
- color operand in the combine operationsrc
- the color source, one of: COMBINE_OBJECT_COLOR
,
COMBINE_TEXTURE_COLOR
,
COMBINE_CONSTANT_COLOR
, or
COMBINE_PREVIOUS_TEXTURE_UNIT_STATE
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2
java.lang.IllegalArgumentException
- if src
is a value other than COMBINE_OBJECT_COLOR
,
COMBINE_TEXTURE_COLOR
,
COMBINE_CONSTANT_COLOR
, or
COMBINE_PREVIOUS_TEXTURE_UNIT_STATE
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public int getCombineRgbSource(int index)
index
- color operand in the combine operation
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int getCombineAlphaSource(int index)
index
- color operand in the combine operation
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setCombineRgbFunction(int index, int function)
index
- color operand in the combine operationfunction
- the color function, one of:
COMBINE_SRC_COLOR
,
COMBINE_ONE_MINUS_SRC_COLOR
,
COMBINE_SRC_ALPHA
, or
COMBINE_ONE_MINUS_SRC_ALPHA
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2
java.lang.IllegalArgumentException
- if function
is a value other than COMBINE_SRC_COLOR
,
COMBINE_ONE_MINUS_SRC_COLOR
,
COMBINE_SRC_ALPHA
, or
COMBINE_ONE_MINUS_SRC_ALPHA
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public void setCombineAlphaFunction(int index, int function)
index
- color operand in the combine operationfunction
- the color function, one of:
COMBINE_SRC_ALPHA
, or
COMBINE_ONE_MINUS_SRC_ALPHA
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2
java.lang.IllegalArgumentException
- if function
is a value other than
COMBINE_SRC_ALPHA
or
COMBINE_ONE_MINUS_SRC_ALPHA
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public int getCombineRgbFunction(int index)
index
- color operand in the combine operation
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int getCombineAlphaFunction(int index)
index
- color operand in the combine operation
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setCombineRgbScale(int scale)
scale
- the scale factor for the rgb components of the output
color. It must be one of the following: 1, 2, or 4.
java.lang.IllegalArgumentException
- if scale
is a
value other than 1, 2, or 4.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public void setCombineAlphaScale(int scale)
scale
- the scale factor for the alpha component of the output
color. It must be one of the following: 1, 2, or 4.
java.lang.IllegalArgumentException
- if scale
is a
value other than 1, 2, or 4.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphCanvas3D.queryProperties()
public int getCombineRgbScale()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int getCombineAlphaScale()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic NodeComponent cloneNodeComponent()
cloneNodeComponent
in class NodeComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |