Go to the documentation of this file.
28 #ifndef __TextureUnitState_H__
29 #define __TextureUnitState_H__
479 BT_TESSELATION_HULL = 3,
481 BT_TESSELATION_DOMAIN = 4,
494 CONTENT_COMPOSITOR = 2
819 Real manualBlend = 0.0);
908 Real manualBlend = 0.0);
1320 #endif // __TextureUnitState_H__
@ TAM_BORDER
Texture coordinates outside the range [0.0, 1.0] are set to the border colour.
const ColourValue & getTextureBorderColour(void) const
Sets the texture border colour.
FilterOptions getTextureFiltering(FilterType ftpye) const
Get the texture filtering for the given type.
void setTextureRotate(const Radian &angle)
Sets the anticlockwise rotation factor applied to texture coordinates.
Pass * getParent(void) const
Gets the parent Pass object.
UVWAddressingMode mAddressMode
void setCurrentFrame(unsigned int frameNumber)
Changes the active frame in an animated or multi-image texture.
void setContentType(ContentType ct)
Set the type of content this TextureUnitState references.
Real getTextureVScale(void) const
Get texture vscale value.
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
Class representing the state of a single texture unit during a Pass of a Technique,...
void createAnimController(void)
Internal method for creating animation controller.
SceneBlendFactor getColourBlendFallbackDest(void) const
Get the multipass fallback for colour blending operation destination factor.
Defines the functionality of a 3D API.
Real getTextureUScale(void) const
Get texture uscale value.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Real getTextureUScroll(void) const
Get texture uscroll value.
const String & getTextureName(void) const
Get the name of current texture image for this layer.
void setTextureCoordSet(unsigned int set)
Sets the index of the set of texture co-ords this layer uses.
void createEffectController(TextureEffect &effect)
Internal method for creating texture effect controller.
void removeAllEffects(void)
Removes all effects applied to this texture layer.
BindingType
The type of unit to bind the texture settings to.
void _notifyParent(Pass *parent)
Notify this object that its parent has changed.
bool isTextureLoadFailing() const
Tests if the texture associated with this unit has failed to load.
void _unload(void)
Internal method for unloading this object as part of Material::unload.
void deleteFrameTextureName(const size_t frameNumber)
Deletes a specific texture frame.
void setTextureMipmapBias(float bias)
Sets the bias value applied to the mipmap calculation.
void addFrameTextureName(const String &name)
Add a Texture name to the end of the frame container.
LayerBlendModeEx mAlphaBlendMode
Real mAnimDuration
Duration of animation in seconds.
FilterOptions mMinFilter
Texture filtering - minification.
const UVWAddressingMode & getTextureAddressingMode(void) const
Gets the texture addressing mode for a given coordinate, i.e.
void _unprepare(void)
Internal method for undoing the preparation this object as part of Material::unprepare.
TextureUnitState(Pass *parent)
Default constructor.
LayerBlendSource
List of valid sources of values for blending operations used in TextureUnitState::setColourOperation ...
bool isLoaded(void) const
Is this loaded?
const String & getTextureNameAlias(void) const
Gets the Texture Name Alias of the Texture Unit.
const TexturePtr & _getTexturePtr(void) const
Get the texture pointer for the current frame.
unsigned int getTextureAnisotropy() const
Get this layer texture anisotropy level.
void setProjectiveTexturing(bool enabled, const Frustum *projectionSettings=0)
Enables or disables projective texturing on this texture unit.
PixelFormat getDesiredFormat(void) const
Gets the desired pixel format when load the texture.
void setTextureNameAlias(const String &name)
Set the alias name used for texture frame names.
bool getTextureCompareEnabled() const
String mCompositorRefName
The data that references the compositor.
@ ENV_PLANAR
Envmap based on vector from camera to vertex position, good for planar geometry.
void ensurePrepared(size_t frame) const
Internal method for ensuring the texture for a given frame is prepared.
float mMipmapBias
Mipmap bias (always float, not Real).
const Matrix4 & getTextureTransform(void) const
Gets the current texture transformation matrix.
unsigned int getTextureCoordSet(void) const
Gets the index of the set of texture co-ords this layer uses.
void setTextureAddressingMode(TextureAddressingMode tam)
Sets the texture addressing mode, i.e.
@ LBS_TEXTURE
the colour derived from the texture assigned to this layer
void setAlphaOperation(LayerBlendOperationEx op, LayerBlendSource source1=LBS_TEXTURE, LayerBlendSource source2=LBS_CURRENT, Real arg1=1.0, Real arg2=1.0, Real manualBlend=0.0)
Sets the alpha operation to be applied to this texture.
TextureFilterOptions
High-level filtering options providing shortcuts to settings the minification, magnification and mip ...
unsigned int getCurrentFrame(void) const
Gets the active frame in an animated or multi-image texture layer.
WaveformType
Enumerates the wave types usable with the Ogre engine.
void retryTextureLoad()
Tells the unit to retry loading the texture if it had failed to load.
bool isCubic(void) const
Returns true if this texture unit is either a series of 6 2D textures, each in it's own frame,...
FilterOptions mMipFilter
Texture filtering - mipmapping.
std::pair< size_t, size_t > getTextureDimensions(unsigned int frame=0) const
Returns the width and height of the texture in the given frame.
Class defining a single pass of a Technique (of a Material), i.e.
PixelFormat mDesiredFormat
bool is3D(void) const
Returns true if this texture layer uses a composite 3D cubic texture.
ContentType getContentType(void) const
Get the type of content this TextureUnitState references.
Class which manages blending of both colour and alpha components.
BindingType mBindingType
Binding type (fragment or vertex pipeline).
void setAnimatedTextureName(const String &name, unsigned int numFrames, Real duration=0)
Sets the names of the texture images for an animated texture.
@ TAM_MIRROR
Texture mirrors (flips) at joins over 1.0.
void setTextureUScale(Real value)
As setTextureScale, but sets only U value.
void setColourOpMultipassFallback(const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor)
Sets the multipass fallback operation for this layer, if you used TextureUnitState::setColourOperatio...
void setTextureAddressingMode(TextureAddressingMode u, TextureAddressingMode v, TextureAddressingMode w)
Sets the texture addressing mode, i.e.
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
unsigned int mMaxAniso
Texture anisotropy.
void setTextureFiltering(TextureFilterOptions filterType)
Set the texture filtering for this unit, using the simplified interface.
void setCubicTexture(const TexturePtr *const texPtrs, bool forUVW=false)
Sets this texture layer to use a combination of 6 texture maps, each one relating to a face of a cube...
const LayerBlendModeEx & getAlphaBlendMode(void) const
Get multitexturing alpha blending mode.
size_t calculateSize(void) const
TextureUnitState(Pass *parent, const TextureUnitState &oth)
void setBindingType(BindingType bt)
Sets the type of unit these texture settings should be bound to.
CompareFunction getTextureCompareFunction() const
bool isHardwareGammaEnabled() const
Gets whether this texture will be set up so that on sampling it, hardware gamma correction is applied...
void setTextureFiltering(FilterType ftype, FilterOptions opts)
Set a single filtering option on this texture unit.
Class encapsulating a standard 4x4 homogeneous matrix.
CompareFunction mCompareFunc
const Radian & getTextureRotate(void) const
Get texture rotation effects angle value.
SceneBlendFactor
Blending factors for manually blending objects with the scene.
PixelFormat
The pixel format used for images, textures, and render surfaces.
@ ENV_CURVED
Envmap based on dot of vector from camera to vertex and vertex normal, good for curves.
BindingType getBindingType(void) const
Gets the type of unit these texture settings should be bound to.
Controller< Real > * mAnimController
void recalcTextureMatrix(void) const
Internal method for calculating texture matrix.
void setTransformAnimation(const TextureTransformType ttype, const WaveformType waveType, Real base=0, Real frequency=1, Real phase=0, Real amplitude=1)
Sets up a general time-relative texture modification effect.
vector< TexturePtr >::type mFramePtrs
bool isBlank(void) const
Determines if this texture layer is currently blank.
ContentType
Enum identifying the type of content this texture unit contains.
@ ET_PROJECTIVE_TEXTURE
Generate texture coords based on a frustum.
void _prepare(void)
Internal method for preparing this object for load, as part of Material::prepare.
map< String, String >::type AliasTextureNamePairList
Alias / Texture name pair (first = alias, second = texture name)
TextureUnitState(Pass *parent, const String &texName, unsigned int texCoordSet=0)
Name-based constructor.
void setCubicTextureName(const String *const names, bool forUVW=false)
Sets this texture layer to use a combination of 6 texture maps, each one relating to a face of a cube...
TextureType mTextureType
Is this a series of 6 2D textures to make up a cube?
size_t mCompositorRefMrtIndex
The index of the referenced texture if referencing an MRT in a compositor.
FilterOptions
Filtering options for textures / mipmaps.
Wrapper class which indicates a given angle value is in Radians.
TextureEffectType
Definition of the broad types of texture effect you can apply to a texture unit.
FilterOptions mMagFilter
Texture filtering - magnification.
SceneBlendFactor getColourBlendFallbackSrc(void) const
Get the multipass fallback for colour blending operation source factor.
@ ET_UVSCROLL
Constant u/v scrolling effect.
void setHardwareGammaEnabled(bool enabled)
Sets whether this texture will be set up so that on sampling it, hardware gamma correction is applied...
const EffectMap & getEffects(void) const
Get texture effects in a multimap paired array.
String mCompositorRefTexName
void setCompositorReference(const String &compositorName, const String &textureName, size_t mrtIndex=0)
Set the compositor reference for this texture unit state.
void setTextureCompareEnabled(bool enabled)
void setCubicTextureName(const String &name, bool forUVW=false)
Sets this texture layer to use a combination of 6 texture maps, each one relating to a face of a cube...
bool hasViewRelativeTextureCoordinateGeneration(void) const
Returns whether this unit has texture coordinate generation that depends on the camera.
void setBlank(void)
Sets this texture layer to be blank.
void setNumMipmaps(int numMipmaps)
Sets how many mipmaps have been requested for the texture.
Real getAnimationDuration(void) const
Get the animated-texture animation duration.
void setColourOperation(const LayerBlendOperation op)
Determines how this texture layer is combined with the one below it (or the diffuse colour of the geo...
LayerBlendOperation
List of valid texture blending operations, for use with TextureUnitState::setColourOperation.
const String & getReferencedTextureName() const
Gets the name of the texture in the compositor that this texture references.
float getTextureMipmapBias(void) const
Gets the bias value applied to the mipmap calculation.
ContentType mContentType
Content type of texture (normal loaded texture, auto-texture).
const TexturePtr & _getTexturePtr(size_t frame) const
Get the texture pointer for a given frame.
~TextureUnitState()
Default destructor.
const String & getName(void) const
Get the name of the Texture Unit State.
void setAnimatedTextureName(const String *const names, unsigned int numFrames, Real duration=0)
Sets the names of the texture images for an animated texture.
static const ColourValue White
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
void setTextureName(const String &name, TextureType ttype=TEX_TYPE_2D)
Sets this texture layer to use a single texture, given the name of the texture to use on this layer.
void setFrameTextureName(const String &name, unsigned int frameNumber)
Sets the name of the texture associated with a frame.
void setEnvironmentMap(bool enable, EnvMapType envMapType=ENV_CURVED)
Turns on/off texture coordinate effect that makes this layer an environment map.
unsigned int getNumFrames(void) const
Gets the number of frames for a texture.
ColourValue mBorderColour
@ TAM_CLAMP
Texture clamps at 1.0.
TextureTransformType
Useful enumeration when dealing with procedural transforms.
void setTextureCompareFunction(CompareFunction function)
void setTextureFiltering(FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter)
Set a the detailed filtering options on this texture unit.
bool applyTextureAliases(const AliasTextureNamePairList &aliasList, const bool apply=true)
Applies texture names to Texture Unit State with matching texture name aliases.
@ ET_ENVIRONMENT_MAP
Generate all texture coords based on angle between camera and vertex.
void setTextureAnisotropy(unsigned int maxAniso)
Sets the anisotropy level to be used for this texture level.
void ensureLoaded(size_t frame) const
Internal method for ensuring the texture for a given frame is loaded.
Class representing colour.
unsigned int mTextureCoordSetIndex
Request number of mipmaps.
void setTextureVScale(Real value)
As setTextureScale, but sets only V value.
void setTextureScroll(Real u, Real v)
Sets the translation offset of the texture, ie scrolls the texture.
void _setTexturePtr(const TexturePtr &texptr, size_t frame)
Set the texture pointer for a given frame (internal use only!).
void setName(const String &name)
Set the name of the Texture Unit State.
Real getTextureVScroll(void) const
Get texture vscroll value.
@ LBS_CURRENT
the colour as built up from previous stages
bool getIsAlpha(void) const
Gets whether this texture is requested to be loaded as alpha if single channel.
@ ENV_REFLECTION
Envmap intended to supply reflection vectors for cube mapping.
void addEffect(TextureEffect &effect)
Generic method for setting up texture effects.
void setDesiredFormat(PixelFormat desiredFormat)
Sets the desired pixel format when load the texture.
@ ET_USCROLL
Constant u scrolling effect.
void setTextureVScroll(Real value)
As setTextureScroll, but sets only V value.
Texture addressing mode for each texture coordinate.
float Real
Software floating point type.
String mName
Optional name for the TUS.
void setColourOperationEx(LayerBlendOperationEx op, LayerBlendSource source1=LBS_TEXTURE, LayerBlendSource source2=LBS_CURRENT, const ColourValue &arg1=ColourValue::White, const ColourValue &arg2=ColourValue::White, Real manualBlend=0.0)
Setting advanced blending options.
TextureCubeFace
Enum identifying the frame indexes for faces of a cube map (not the composite 3D type.
@ TAM_WRAP
Texture wraps at values over 1.0.
LayerBlendOperationEx
Expert list of valid texture blending operations, for use with TextureUnitState::setColourOperationEx...
vector< String >::type mFrames
void _load(void)
Internal method for loading this object as part of Material::load.
TextureType
Enum identifying the texture type.
void setGamma(Real gamma)
Sets the gamma adjustment factor applied to this texture on loading the data.
void setTextureUScroll(Real value)
As setTextureScroll, but sets only U value.
int getNumMipmaps(void) const
Gets how many mipmaps have been requested for the texture.
void setIsAlpha(bool isAlpha)
Sets whether this texture is requested to be loaded as alpha if single channel.
void removeEffect(const TextureEffectType type)
Removes a single effect applied to this texture layer.
void setScrollAnimation(Real uSpeed, Real vSpeed)
Sets up an animated scroll for the texture layer.
const LayerBlendModeEx & getColourBlendMode(void) const
Get multitexturing colour blending mode.
void setTextureBorderColour(const ColourValue &colour)
Sets the texture border colour.
void setRotateAnimation(Real speed)
Sets up an animated texture rotation for this layer.
const String & getFrameTextureName(unsigned int frameNumber) const
Gets the name of the texture associated with a frame number.
const String & getReferencedCompositorName() const
Gets the name of the compositor that this texture referneces.
SceneBlendFactor mColourBlendFallbackSrc
Controller< Real > * controller
multimap< TextureEffectType, TextureEffect >::type EffectMap
Texture effects in a multimap paired array.
void setTextureAddressingMode(const UVWAddressingMode &uvw)
Sets the texture addressing mode, i.e.
size_t getReferencedMRTIndex() const
Gets the MRT index of the texture in the compositor that this texture references.
TextureType getTextureType(void) const
Returns the type of this texture.
void setTextureTransform(const Matrix4 &xform)
Sets a matrix used to transform any texture coordinates on this layer.
SceneBlendFactor mColourBlendFallbackDest
@ TEX_TYPE_2D
2D texture, used in combination with 2D texture coordinates (default)
void _setTexturePtr(const TexturePtr &texptr)
Set the texture pointer for the current frame (internal use only!).
Controller< Real > * _getAnimController() const
Gets the animation controller (as created because of setAnimatedTexture) if it exists.
String mTextureNameAlias
Optional alias for texture frames.
void _notifyNeedsRecompile(void)
Tells the class that it needs recompilation.
unsigned int mCurrentFrame
The current animation frame.
Real getGamma() const
Returns the gamma adjustment factor applied to this texture on loading.
void setTextureScale(Real uScale, Real vScale)
Sets the scaling factor applied to texture coordinates.
LayerBlendModeEx mColourBlendMode
EnvMapType
Enumeration to specify type of envmap.
@ ET_ROTATE
Constant rotation.
Internal structure defining a texture effect.
@ ET_VSCROLL
Constant u/v scrolling effect.
void setTexture(const TexturePtr &texPtr)
Sets this texture layer to use a single texture, given the pointer to the texture to use on this laye...
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.