public class TextureAttributes extends NodeComponent
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()
Modifier and Type | Field and Description |
---|---|
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_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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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 |
getPerspectiveCorrectionMode()
Gets perspective correction mode value.
|
void |
getTextureBlendColor(Color4f textureBlendColor)
Gets the texture blend color for this
appearance component object.
|
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 |
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.
|
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
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_COMBINE_READ
public static final int ALLOW_COMBINE_WRITE
public static final int FASTEST
public static final int NICEST
public 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
public static final int COMBINE_MODULATE
public static final int COMBINE_ADD
public static final int COMBINE_ADD_SIGNED
public static final int COMBINE_SUBTRACT
public static final int COMBINE_INTERPOLATE
public static final int COMBINE_DOT3
public static final int COMBINE_OBJECT_COLOR
public static final int COMBINE_TEXTURE_COLOR
public static final int COMBINE_CONSTANT_COLOR
public static final int COMBINE_PREVIOUS_TEXTURE_UNIT_STATE
public static final int COMBINE_SRC_COLOR
public static final int COMBINE_ONE_MINUS_SRC_COLOR
public static final int COMBINE_SRC_ALPHA
public static final int COMBINE_ONE_MINUS_SRC_ALPHA
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
java.lang.IllegalArgumentException
- if mode value is other
than FASTEST
or NICEST
.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 colorCapabilityNotSetException
- 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 colorCapabilityNotSetException
- 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 colorCapabilityNotSetException
- 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 objectCapabilityNotSetException
- 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 transformCapabilityNotSetException
- 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 graphjava.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 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
> 2java.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
> 2java.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 operationjava.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2CapabilityNotSetException
- 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 operationjava.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2CapabilityNotSetException
- 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
> 2java.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
> 2java.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 operationjava.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2CapabilityNotSetException
- 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 operationjava.lang.IndexOutOfBoundsException
- if index
< 0 or
index
> 2CapabilityNotSetException
- 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