|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.state.RenderState
com.jme.scene.state.TextureState
public abstract class TextureState
TextureState
maintains a texture state for a given node and
it's children. The number of states that a TextureState can maintain at one
time is equal to the number of texture units available on the GPU. It is not
within the scope of this class to generate the texture, and is recommended
that TextureManager
be used to create the Texture objects.
TextureManager
Nested Class Summary | |
---|---|
static class |
TextureState.CorrectionType
|
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState |
---|
RenderState.StateType |
Field Summary | |
---|---|
protected static boolean |
automaticMipMaps
True if non-GLU mipmap generation (part of FBO) is supported. |
protected static boolean |
automaticMipMapsDetected
|
protected static Texture |
defaultTexture
|
protected int |
firstTexture
|
protected int[] |
idCache
|
protected int |
lastTexture
|
protected static float |
maxAnisotropic
|
protected static int |
numFixedTexUnits
The number of texture units availible for fixed functionality |
protected static int |
numFragmentTexCoordUnits
The number of texture coordinate sets available |
protected static int |
numFragmentTexUnits
The number of texture units availible to fragment shader |
protected static int |
numTotalTexUnits
The total number of supported texture units. |
protected static int |
numVertexTexUnits
The number of texture units availible to vertex shader |
protected int |
offset
offset is used to denote where to begin access of texture coordinates. |
protected static boolean |
supportsAniso
True if anisofiltering is supported. |
protected static boolean |
supportsAnisoDetected
|
protected static boolean |
supportsDepthTexture
True if depth textures are supported |
protected static boolean |
supportsEnvCombine
True if combine dot3 is supported. |
protected static boolean |
supportsEnvCombineDetected
|
protected static boolean |
supportsEnvDot3
True if combine dot3 is supported. |
protected static boolean |
supportsEnvDot3Detected
|
protected static boolean |
supportsMultiTexture
True if multitexturing is supported. |
protected static boolean |
supportsMultiTextureDetected
|
protected static boolean |
supportsNonPowerTwo
True if non pow 2 texture sizes are supported. |
protected static boolean |
supportsNonPowerTwoDetected
|
protected static boolean |
supportsRectangular
True if rectangular textures are supported (vs. |
protected static boolean |
supportsRectangularDetected
|
protected static boolean |
supportsS3TCCompression
True if S3TC compression is supported. |
protected static boolean |
supportsS3TCCompressionDetected
|
protected static boolean |
supportsShadow
True if shadow mapping supported |
protected static boolean |
supportsTexture3D
True if Texture3D is supported. |
protected static boolean |
supportsTexture3DDetected
|
protected static boolean |
supportsTextureCubeMap
True if TextureCubeMap is supported. |
protected static boolean |
supportsTextureCubeMapDetected
|
protected java.util.ArrayList<Texture> |
texture
The texture(s). |
Fields inherited from class com.jme.scene.state.RenderState |
---|
QUICK_COMPARE, RS_BLEND, RS_CLIP, RS_COLORMASK_STATE, RS_CULL, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER |
Constructor Summary | |
---|---|
TextureState()
Constructor instantiates a new TextureState object. |
Method Summary | |
---|---|
void |
clearTextures()
Removes all textures in this texture state. |
abstract void |
delete(int unit)
Removes the texture of the given unit. |
abstract void |
deleteAll()
Removes all Texture set in this TextureState. |
abstract void |
deleteAll(boolean removeFromCache)
Removes all Texture set in this TextureState. |
void |
deleteTextureId(int textureId)
|
java.lang.Class<? extends TextureState> |
getClassTag()
|
TextureState.CorrectionType |
getCorrectionType()
getCorrectionType returns the correction mode for the texture state. |
static Texture |
getDefaultTexture()
|
static Image |
getDefaultTextureImage()
|
float |
getMaxAnisotropic()
Returns the maximum anisotropic filter. |
static int |
getNumberOfFixedUnits()
getNumberOfFixedUnits returns the number of texture units
the computer's graphics card supports, for use in the fixed pipeline. |
static int |
getNumberOfFragmentTexCoordUnits()
getNumberOfFragmentTexCoordUnits returns the number of
texture coordinate sets available that this graphics card supports. |
static int |
getNumberOfFragmentUnits()
getNumberOfFragmentUnits returns the number of texture units
available to a fragment shader that this graphics card supports. |
int |
getNumberOfSetTextures()
Returns the number of textures this texture manager is maintaining. |
static int |
getNumberOfTotalUnits()
getNumberOfTotalUnits returns the number texture units the
computer's graphics card supports. |
static int |
getNumberOfVertexUnits()
getNumberOfVertexUnits returns the number of texture units
available to a vertex shader that this graphics card supports. |
RenderState.StateType |
getStateType()
getStateType returns the type RenderState.StateType.Texture |
Texture |
getTexture()
getTexture gets the texture that is assigned to the first
texture unit. |
Texture |
getTexture(int textureUnit)
getTexture retrieves the texture being used by the state
in a particular texture unit. |
int |
getTextureCoordinateOffset()
setTextureCoordinateOffset gets the offset value used to
determine which coordinates to use for texturing Geometry. |
int |
getTextureID(int textureUnit)
Fast access for retrieving a Texture ID. |
static int |
getTotalNumberOfUnits()
getTotalNumberOfUnits returns the total number of texture
units the computer's graphics card supports. |
int |
getType()
Deprecated. As of 2.0, use RenderState.getStateType() instead. |
static boolean |
isAnisoSupported()
|
boolean |
isAutomaticMipmapsSupported()
Returns if AutomaticMipmap generation is available for textures. |
static boolean |
isEnvCombineSupported()
|
static boolean |
isEnvDot3Supported()
|
static boolean |
isMultiTextureSupported()
|
static boolean |
isNonPowerOfTwoTextureSupported()
|
static boolean |
isRectangularTextureSupported()
|
boolean |
isS3TCSupported()
Returns if S3TC compression is available for textures. |
boolean |
isTexture3DSupported()
Returns if Texture3D is available for textures. |
boolean |
isTextureCubeMapSupported()
Returns if TextureCubeMap is available for textures. |
void |
load()
Loads our textures into the underlying rendering system, generating mip maps if appropriate. |
abstract void |
load(int unit)
Loads the texture for the given unit into the underlying rendering system, generating mip maps if appropriate. |
static void |
overrideAnisoSupport(boolean use)
Overide setting of support for Anisotropic texture filtering. |
static void |
overrideAutomaticMipmapsSupport(boolean use)
Overide setting of AutomaticMipmap generation support. |
static void |
overrideEnvCombineSupport(boolean use)
Overide support for combine environment texture settings |
static void |
overrideEnvDot3Support(boolean use)
Overide support for dot3 environment texture settings |
static void |
overrideMultiTextureSupport(boolean use)
Overide setting of fixed function multi-texturing support. |
static void |
overrideNonPowerOfTwoTextureSupport(boolean use)
Overide setting of support for non-pow2 texture sizes. |
static void |
overrideRectangularTextureSupport(boolean use)
Overide auto-detected setting of support for rectangular texture sizes (width != height). |
static void |
overrideS3TCSupport(boolean use)
Overide setting of S3TC compression support. |
static void |
overrideTexture3DSupport(boolean use)
Overide setting of Texture3D support. |
static void |
overrideTextureCubeMapSupport(boolean use)
Overide setting of TextureCubeMap support. |
void |
read(JMEImporter e)
|
boolean |
removeTexture(int textureUnit)
|
boolean |
removeTexture(Texture tex)
|
static void |
resetAnisoSupport()
Reset dot3 environment texture support to driver-detected setting. |
static void |
resetAutomaticMipmapsSupport()
Reset AutomaticMipmap generation support to driver-detected setting. |
static void |
resetEnvCombineSupport()
Reset combine environment texture support to driver-detected setting. |
static void |
resetEnvDot3Support()
Reset dot3 environment texture support to driver-detected setting. |
protected void |
resetFirstLast()
Updates firstTexture to be the first non-null Texture, and lastTexture to be the last non-null texture. |
static void |
resetMultiTextureSupport()
Reset fixed function multi-texturing support to driver-detected setting. |
static void |
resetNonPowerOfTwoTextureSupport()
Reset support for non-pow2 texture sizes to driver-detected setting. |
static void |
resetRectangularTextureSupport()
Reset support for rectangular texture sizes to driver-detected setting. |
static void |
resetS3TCSupport()
Reset dot3 environment texture support to driver-detected setting. |
static void |
resetTexture3DSupport()
Reset Texture3D support to driver-detected setting. |
static void |
resetTextureCubeMapSupport()
Reset TextureCubeMap support to driver-detected setting. |
void |
setCorrectionType(TextureState.CorrectionType type)
setCorrectionType sets the image correction type for this
texture state. |
void |
setTexture(Texture texture)
setTexture sets a single texture to the first texture
unit. |
void |
setTexture(Texture texture,
int textureUnit)
setTexture sets the texture object to be used by the
state. |
void |
setTextureCoordinateOffset(int offset)
setTextureCoordinateOffset sets the offset value used to
determine which coordinates to use for texturing Geometry. |
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.state.RenderState |
---|
apply, createStateRecord, extract, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Texture defaultTexture
protected transient java.util.ArrayList<Texture> texture
protected static int numTotalTexUnits
protected static int numFixedTexUnits
protected static int numVertexTexUnits
protected static int numFragmentTexUnits
protected static int numFragmentTexCoordUnits
protected static float maxAnisotropic
protected static boolean supportsMultiTexture
protected static boolean supportsMultiTextureDetected
protected static boolean supportsEnvDot3
protected static boolean supportsEnvDot3Detected
protected static boolean supportsEnvCombine
protected static boolean supportsEnvCombineDetected
protected static boolean supportsAniso
protected static boolean supportsAnisoDetected
protected static boolean supportsNonPowerTwo
protected static boolean supportsNonPowerTwoDetected
protected static boolean supportsRectangular
protected static boolean supportsRectangularDetected
protected static boolean supportsS3TCCompression
protected static boolean supportsS3TCCompressionDetected
protected static boolean supportsTexture3D
protected static boolean supportsTexture3DDetected
protected static boolean supportsTextureCubeMap
protected static boolean supportsTextureCubeMapDetected
protected static boolean automaticMipMaps
protected static boolean automaticMipMapsDetected
protected static boolean supportsDepthTexture
protected static boolean supportsShadow
protected transient int firstTexture
protected transient int lastTexture
protected int offset
protected transient int[] idCache
Constructor Detail |
---|
public TextureState()
TextureState
object.
Method Detail |
---|
public int getType()
RenderState.getStateType()
instead.
getType
returns this type of render state. (RS_TEXTURE).
getType
in class RenderState
RenderState.getType()
public RenderState.StateType getStateType()
getStateType
returns the type RenderState.StateType.Texture
getStateType
in class RenderState
RenderState.StateType.Texture
RenderState.getStateType()
public void setTexture(Texture texture)
setTexture
sets a single texture to the first texture
unit.
texture
- the texture to set.public Texture getTexture()
getTexture
gets the texture that is assigned to the first
texture unit.
public void setTexture(Texture texture, int textureUnit)
setTexture
sets the texture object to be used by the
state. The texture unit that this texture uses is set, if the unit is not
valid, i.e. less than zero or greater than the number of texture units
supported by the graphics card, it is ignored.
texture
- the texture to be used by the state.textureUnit
- the texture unit this texture will fill.public Texture getTexture(int textureUnit)
getTexture
retrieves the texture being used by the state
in a particular texture unit.
textureUnit
- the texture unit to retrieve the texture from.
public boolean removeTexture(Texture tex)
public boolean removeTexture(int textureUnit)
public void clearTextures()
public void setCorrectionType(TextureState.CorrectionType type)
setCorrectionType
sets the image correction type for this
texture state.
type
- the correction type for this texture.
java.lang.IllegalArgumentException
- if type is nullpublic TextureState.CorrectionType getCorrectionType()
getCorrectionType
returns the correction mode for the texture state.
public static int getTotalNumberOfUnits()
getTotalNumberOfUnits
returns the total number of texture
units the computer's graphics card supports.
public static int getNumberOfFixedUnits()
getNumberOfFixedUnits
returns the number of texture units
the computer's graphics card supports, for use in the fixed pipeline.
public static int getNumberOfVertexUnits()
getNumberOfVertexUnits
returns the number of texture units
available to a vertex shader that this graphics card supports.
public static int getNumberOfFragmentUnits()
getNumberOfFragmentUnits
returns the number of texture units
available to a fragment shader that this graphics card supports.
public static int getNumberOfFragmentTexCoordUnits()
getNumberOfFragmentTexCoordUnits
returns the number of
texture coordinate sets available that this graphics card supports.
public static int getNumberOfTotalUnits()
getNumberOfTotalUnits
returns the number texture units the
computer's graphics card supports.
public int getNumberOfSetTextures()
public final int getTextureID(int textureUnit)
textureUnit
is any number under or equal to the highest
textureunit currently in use. This value can be retrieved with
getNumberOfSetTextures
. A higher value might result in
unexpected behaviour such as an exception being thrown.
textureUnit
- The texture unit from which to retrieve the ID.
public void setTextureCoordinateOffset(int offset)
setTextureCoordinateOffset
sets the offset value used to
determine which coordinates to use for texturing Geometry.
offset
- the offset (default 0).public int getTextureCoordinateOffset()
setTextureCoordinateOffset
gets the offset value used to
determine which coordinates to use for texturing Geometry.
public void load()
public abstract void load(int unit)
public abstract void delete(int unit)
unit
- The unit of the Texture to remove.public abstract void deleteAll()
public abstract void deleteAll(boolean removeFromCache)
public float getMaxAnisotropic()
protected void resetFirstLast()
public static boolean isMultiTextureSupported()
public static void overrideMultiTextureSupport(boolean use)
use
- public static void resetMultiTextureSupport()
public static boolean isEnvDot3Supported()
public static void overrideEnvDot3Support(boolean use)
use
- public static void resetEnvDot3Support()
public static boolean isEnvCombineSupported()
public static void overrideEnvCombineSupport(boolean use)
use
- public static void resetEnvCombineSupport()
public boolean isS3TCSupported()
public static void overrideS3TCSupport(boolean use)
use
- public static void resetS3TCSupport()
public boolean isTexture3DSupported()
public static void overrideTexture3DSupport(boolean use)
use
- public static void resetTexture3DSupport()
public boolean isTextureCubeMapSupported()
public static void overrideTextureCubeMapSupport(boolean use)
use
- public static void resetTextureCubeMapSupport()
public boolean isAutomaticMipmapsSupported()
public static void overrideAutomaticMipmapsSupport(boolean use)
use
- public static void resetAutomaticMipmapsSupport()
public static boolean isAnisoSupported()
public static void overrideAnisoSupport(boolean use)
use
- public static void resetAnisoSupport()
public static boolean isNonPowerOfTwoTextureSupported()
public static void overrideNonPowerOfTwoTextureSupport(boolean use)
use
- public static void resetNonPowerOfTwoTextureSupport()
public static boolean isRectangularTextureSupported()
public static void overrideRectangularTextureSupport(boolean use)
use
- public static void resetRectangularTextureSupport()
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class RenderState
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class RenderState
java.io.IOException
public java.lang.Class<? extends TextureState> getClassTag()
getClassTag
in interface Savable
getClassTag
in class RenderState
public void deleteTextureId(int textureId)
public static Image getDefaultTextureImage()
public static Texture getDefaultTexture()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |