|
||||||||||
| 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
|
| Field Summary |
|---|
| 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)
|
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. |
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()
getType returns this type of render state. |
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. |
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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextureState()
TextureState object.
| Method Detail |
|---|
public int getType()
getType returns this type of render state. (RS_TEXTURE).
getType in class RenderStateRenderState.getType()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.
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()
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 IOException
write in interface Savablewrite in class RenderStateIOException
public void read(JMEImporter e)
throws IOException
read in interface Savableread in class RenderStateIOExceptionpublic Class<? extends TextureState> getClassTag()
getClassTag in interface SavablegetClassTag in class RenderStatepublic 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 | |||||||||