|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.TextureInfo
TextureInfo is jPCT's key to multi texturing. Multi texturing is supported by
the OpenGL renderer only. You may still use the software renderer to render
such a scene, but it will simply ignore the additional texture stages. You
can use addTriangle() or setTexture() in Object3D to define a polygon or the
whole object as multi textured.
You can use any combination of textures and blending modes for a polygon.
jPCT will try to optimize the texture state changes when rendering the image.
However, don't overuse this feature on a single object, because jPCT can only
do so much.
If you are adding more layers than the hardware supports, jPCT will switch to
multi pass rendering automatically. Due to the way the OpenGL pipeline is
specified, this may produce different results compared to one pass multi
texturing. This happens most when using transparency, fog or blending modes
like MODE_ADD, when the card's internal accuracy is higher than the
framebuffer's.
Field Summary | |
static int |
MAX_PHYSICAL_TEXTURE_STAGES
The maximum number of physical texture layers available. |
static int |
MODE_ADD
Use addition for adding this texture layer |
static int |
MODE_ADD_SIGNED
Use a signed add for adding this texture layer, i.e. 50% grey means no change, everything above will be added and everything below will be subtracted. |
static int |
MODE_BLEND
Use blending for adding this texture layer. |
static int |
MODE_DECAL
Use the layer as a decal, i.e. the alpha channel defines the opacity. |
static int |
MODE_MODULATE
Use multiplication of color values for adding this texture layer |
static int |
MODE_REPLACE
For the sake of completeness. |
static int |
MODE_SUBTRACT
Use subtraction for this texture layer |
Constructor Summary | |
TextureInfo(int texID)
Creates a new TextureInfo. |
|
TextureInfo(int texID,
float u0,
float v0,
float u1,
float v1,
float u2,
float v2)
Creates a new TextureInfo. |
Method Summary | |
void |
add(int texID,
float u0,
float v0,
float u1,
float v1,
float u2,
float v2,
int mode)
Adds another texture layer. |
void |
add(int texID,
int mode)
Adds another texture layer. |
void |
set(int texID,
int stageCnt,
float u0,
float v0,
float u1,
float v1,
float u2,
float v2,
int mode)
Sets the values of an existing layer. |
void |
set(int texID,
int stageCnt,
int mode)
Sets the values of an existing layer. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MODE_MODULATE
public static final int MODE_ADD
public static final int MODE_REPLACE
public static final int MODE_BLEND
public static final int MODE_ADD_SIGNED
public static final int MODE_SUBTRACT
public static final int MODE_DECAL
public static final int MAX_PHYSICAL_TEXTURE_STAGES
Constructor Detail |
public TextureInfo(int texID, float u0, float v0, float u1, float v1, float u2, float v2)
texID
- int the ID of the Texture as the TextureManager sees it.u0
- float the u-coordinate for the first vertexv0
- float the v-coordinate for the first vertexu1
- float the u-coordinate for the second vertexv1
- float the v-coordinate for the second vertexu2
- float the u-coordinate for the third vertexv2
- float the v-coordinate for the third vertexpublic TextureInfo(int texID)
texID
- int the ID of the Texture as the TextureManager sees it.Method Detail |
public void add(int texID, int mode)
texID
- int the Texture's IDmode
- int the combination modepublic void set(int texID, int stageCnt, int mode)
texID
- int the ID of the Texture as the TextureManager sees it.stageCnt
- int the stagemode
- int the combination modepublic void add(int texID, float u0, float v0, float u1, float v1, float u2, float v2, int mode)
texID
- int the ID of the Texture as the TextureManager sees it.u0
- float the u-coordinate for the first vertexv0
- float the v-coordinate for the first vertexu1
- float the u-coordinate for the second vertexv1
- float the v-coordinate for the second vertexu2
- float the u-coordinate for the third vertexv2
- float the v-coordinate for the third vertexmode
- int the combination modepublic void set(int texID, int stageCnt, float u0, float v0, float u1, float v1, float u2, float v2, int mode)
texID
- int the ID of the Texture as the TextureManager sees it.stageCnt
- int the stageu0
- float the u-coordinate for the first vertexv0
- float the v-coordinate for the first vertexu1
- float the u-coordinate for the second vertexv1
- float the v-coordinate for the second vertexu2
- float the u-coordinate for the third vertexv2
- float the v-coordinate for the third vertexmode
- int the combination mode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |