OgreTextureUnitState.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __TextureUnitState_H__
29 #define __TextureUnitState_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreCommon.h"
33 #include "OgreBlendMode.h"
34 #include "OgreMatrix4.h"
35 #include "OgreIteratorWrappers.h"
36 #include "OgreString.h"
37 #include "OgreTexture.h"
38 #include "OgreHeaderPrefix.h"
39 
40 namespace Ogre {
63  {
64  friend class RenderSystem;
65  public:
72  {
86  ET_TRANSFORM
87 
88  };
89 
96  {
104  ENV_NORMAL
105  };
106 
113  {
118  TT_ROTATE
119  };
120 
127  {
137  TAM_UNKNOWN = 99
138  };
139 
142  {
144  };
145 
149  {
150  CUBE_FRONT = 0,
151  CUBE_BACK = 1,
152  CUBE_LEFT = 2,
153  CUBE_RIGHT = 3,
154  CUBE_UP = 4,
155  CUBE_DOWN = 5
156  };
157 
160  struct TextureEffect {
162  int subtype;
163  Real arg1, arg2;
170  const Frustum* frustum;
171  };
172 
176 
180 
181  TextureUnitState(Pass* parent, const TextureUnitState& oth );
182 
183  TextureUnitState & operator = ( const TextureUnitState& oth );
184 
188 
195  TextureUnitState( Pass* parent, const String& texName, unsigned int texCoordSet = 0);
196 
205  const String& getTextureName(void) const;
206 
212  void setTextureName( const String& name, TextureType ttype = TEX_TYPE_2D);
213 
219  void setTexture( const TexturePtr& texPtr);
220 
267  void setCubicTextureName( const String& name, bool forUVW = false );
268 
313  void setCubicTextureName( const String* const names, bool forUVW = false );
314 
359  void setCubicTexture( const TexturePtr* const texPtrs, bool forUVW = false );
360 
382  void setAnimatedTextureName( const String& name, unsigned int numFrames, Real duration = 0 );
383 
405  void setAnimatedTextureName( const String* const names, unsigned int numFrames, Real duration = 0 );
406 
409  std::pair< size_t, size_t > getTextureDimensions( unsigned int frame = 0 ) const;
410 
418  void setCurrentFrame( unsigned int frameNumber );
419 
424  unsigned int getCurrentFrame(void) const;
425 
431  const String& getFrameTextureName(unsigned int frameNumber) const;
432 
442  void setFrameTextureName(const String& name, unsigned int frameNumber);
443 
450  void addFrameTextureName(const String& name);
459  void deleteFrameTextureName(const size_t frameNumber);
464  unsigned int getNumFrames(void) const;
465 
466 
469  {
471  BT_FRAGMENT = 0,
475  BT_VERTEX = 1,
477  BT_GEOMETRY = 2,
479  BT_TESSELATION_HULL = 3,
481  BT_TESSELATION_DOMAIN = 4,
483  BT_COMPUTE = 5
484  };
488  {
490  CONTENT_NAMED = 0,
492  CONTENT_SHADOW = 1,
494  CONTENT_COMPOSITOR = 2
495  };
496 
507 
511 
520 
527  bool isCubic(void) const;
528 
533  bool is3D(void) const;
534 
540 
543  void setDesiredFormat(PixelFormat desiredFormat);
544 
548 
551  void setNumMipmaps(int numMipmaps);
552 
555  int getNumMipmaps(void) const;
556 
559  void setIsAlpha(bool isAlpha);
560 
563  bool getIsAlpha(void) const;
564 
566  Real getGamma() const { return mGamma; }
568  void setGamma(Real gamma) { mGamma = gamma; }
569 
571  void setHardwareGammaEnabled(bool enabled);
574 
579  unsigned int getTextureCoordSet(void) const;
580 
588  void setTextureCoordSet(unsigned int set);
589 
605  void setTextureTransform(const Matrix4& xform);
606 
614  const Matrix4& getTextureTransform(void) const;
615 
631 
636  void setTextureUScroll(Real value);
638  Real getTextureUScroll(void) const;
639 
644  void setTextureVScroll(Real value);
646  Real getTextureVScroll(void) const;
647 
652  void setTextureUScale(Real value);
654  Real getTextureUScale(void) const;
655 
660  void setTextureVScale(Real value);
662  Real getTextureVScale(void) const;
663 
677  void setTextureScale(Real uScale, Real vScale);
678 
688  void setTextureRotate(const Radian& angle);
690  const Radian& getTextureRotate(void) const;
691 
698 
713 
722 
730 
738  void setTextureBorderColour(const ColourValue& colour);
739 
746 
813  LayerBlendSource source1 = LBS_TEXTURE,
814  LayerBlendSource source2 = LBS_CURRENT,
815 
816  const ColourValue& arg1 = ColourValue::White,
817  const ColourValue& arg2 = ColourValue::White,
818 
819  Real manualBlend = 0.0);
820 
840 
860  void setColourOpMultipassFallback( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
861 
865 
869 
873 
877 
904  LayerBlendSource source1 = LBS_TEXTURE,
905  LayerBlendSource source2 = LBS_CURRENT,
906  Real arg1 = 1.0,
907  Real arg2 = 1.0,
908  Real manualBlend = 0.0);
909 
921  void addEffect(TextureEffect& effect);
922 
949  void setEnvironmentMap(bool enable, EnvMapType envMapType = ENV_CURVED);
950 
961  void setScrollAnimation(Real uSpeed, Real vSpeed);
962 
972 
993  const WaveformType waveType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1 );
994 
995 
1016  void setProjectiveTexturing(bool enabled, const Frustum* projectionSettings = 0);
1017 
1020  void removeAllEffects(void);
1021 
1027  void removeEffect( const TextureEffectType type );
1028 
1034  bool isBlank(void) const;
1035 
1038  void setBlank(void);
1039 
1042  bool isTextureLoadFailing() const { return mTextureLoadFailed; }
1043 
1046  void retryTextureLoad() { mTextureLoadFailed = false; }
1047 
1049  const EffectMap& getEffects(void) const;
1052 
1082  void setTextureFiltering(FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter);
1085 
1086  void setTextureCompareEnabled(bool enabled);
1088 
1091 
1099  void setTextureAnisotropy(unsigned int maxAniso);
1101  unsigned int getTextureAnisotropy() const;
1102 
1116  void setTextureMipmapBias(float bias) { mMipmapBias = bias; }
1120  float getTextureMipmapBias(void) const { return mMipmapBias; }
1121 
1132  void setCompositorReference(const String& compositorName, const String& textureName, size_t mrtIndex = 0);
1133 
1135  const String& getReferencedCompositorName() const { return mCompositorRefName; }
1137  const String& getReferencedTextureName() const { return mCompositorRefTexName; }
1139  size_t getReferencedMRTIndex() const { return mCompositorRefMrtIndex; }
1140 
1142  Pass* getParent(void) const { return mParent; }
1143 
1145  void _prepare(void);
1147  void _unprepare(void);
1149  void _load(void);
1151  void _unload(void);
1154 
1156  bool isLoaded(void) const;
1159 
1165  void setName(const String& name);
1167  const String& getName(void) const { return mName; }
1168 
1173  void setTextureNameAlias(const String& name);
1176  const String& getTextureNameAlias(void) const { return mTextureNameAlias;}
1177 
1192  bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true);
1193 
1195  void _notifyParent(Pass* parent);
1196 
1198  const TexturePtr& _getTexturePtr(void) const;
1200  const TexturePtr& _getTexturePtr(size_t frame) const;
1201 
1203  void _setTexturePtr(const TexturePtr& texptr);
1205  void _setTexturePtr(const TexturePtr& texptr, size_t frame);
1206 
1207  size_t calculateSize(void) const;
1208 
1212  Controller<Real>* _getAnimController() const { return mAnimController; }
1213 protected:
1214  // State
1216  unsigned int mCurrentFrame;
1217 
1220  bool mCubic;
1221 
1225 
1229 
1233 
1235  mutable bool mTextureLoadFailed;
1236  bool mIsAlpha;
1237  bool mHwGamma;
1239 
1240  mutable bool mRecalcTexMatrix;
1241  Real mUMod, mVMod;
1242  Real mUScale, mVScale;
1245 
1252 
1255 
1257  unsigned int mMaxAniso;
1260 
1269 
1270  //-----------------------------------------------------------------------------
1271  // Complex members (those that can't be copied using memcpy) are at the end to
1272  // allow for fast copying of the basic members.
1273  //
1282  //-----------------------------------------------------------------------------
1283 
1284  //-----------------------------------------------------------------------------
1285  // Pointer members (those that can't be copied using memcpy), and MUST
1286  // preserving even if assign from others
1287  //
1290  //-----------------------------------------------------------------------------
1291 
1292 
1295  void recalcTextureMatrix(void) const;
1296 
1300 
1304 
1306  void ensurePrepared(size_t frame) const;
1308  void ensureLoaded(size_t frame) const;
1309 
1310 
1311  };
1312 
1316 } // namespace Ogre
1317 
1318 #include "OgreHeaderSuffix.h"
1319 
1320 #endif // __TextureUnitState_H__
OgreHeaderSuffix.h
Ogre::TextureUnitState::TAM_BORDER
@ TAM_BORDER
Texture coordinates outside the range [0.0, 1.0] are set to the border colour.
Definition: OgreTextureUnitState.h:135
Ogre::TextureUnitState::getTextureBorderColour
const ColourValue & getTextureBorderColour(void) const
Sets the texture border colour.
Ogre::TextureUnitState::getTextureFiltering
FilterOptions getTextureFiltering(FilterType ftpye) const
Get the texture filtering for the given type.
Ogre::TextureUnitState::setTextureRotate
void setTextureRotate(const Radian &angle)
Sets the anticlockwise rotation factor applied to texture coordinates.
Ogre::TextureUnitState::getParent
Pass * getParent(void) const
Gets the parent Pass object.
Definition: OgreTextureUnitState.h:1142
Ogre::TextureUnitState::mAddressMode
UVWAddressingMode mAddressMode
Definition: OgreTextureUnitState.h:1227
Ogre::TextureUnitState::setCurrentFrame
void setCurrentFrame(unsigned int frameNumber)
Changes the active frame in an animated or multi-image texture.
Ogre::TextureUnitState::setContentType
void setContentType(ContentType ct)
Set the type of content this TextureUnitState references.
Ogre::TextureUnitState::getTextureVScale
Real getTextureVScale(void) const
Get texture vscale value.
Ogre::TextureUnitState::TextureAddressingMode
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
Definition: OgreTextureUnitState.h:127
Ogre::TextureUnitState
Class representing the state of a single texture unit during a Pass of a Technique,...
Definition: OgreTextureUnitState.h:63
Ogre::TextureUnitState::mRecalcTexMatrix
bool mRecalcTexMatrix
Definition: OgreTextureUnitState.h:1240
Ogre::TextureUnitState::createAnimController
void createAnimController(void)
Internal method for creating animation controller.
Ogre::TextureUnitState::getColourBlendFallbackDest
SceneBlendFactor getColourBlendFallbackDest(void) const
Get the multipass fallback for colour blending operation destination factor.
Ogre::RenderSystem
Defines the functionality of a 3D API.
Definition: OgreRenderSystem.h:126
Ogre::TextureUnitState::getTextureUScale
Real getTextureUScale(void) const
Get texture uscale value.
Ogre::TextureUnitState::TextureEffect::frequency
Real frequency
Definition: OgreTextureUnitState.h:166
Ogre::TextureUnitState::TextureEffect::arg2
Real arg2
Definition: OgreTextureUnitState.h:163
Ogre::TextureUnitState::mHwGamma
bool mHwGamma
Definition: OgreTextureUnitState.h:1237
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:59
Ogre::TextureUnitState::getTextureUScroll
Real getTextureUScroll(void) const
Get texture uscroll value.
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::TextureUnitState::getTextureName
const String & getTextureName(void) const
Get the name of current texture image for this layer.
Ogre::TextureUnitState::setTextureCoordSet
void setTextureCoordSet(unsigned int set)
Sets the index of the set of texture co-ords this layer uses.
Ogre::TextureUnitState::createEffectController
void createEffectController(TextureEffect &effect)
Internal method for creating texture effect controller.
Ogre::TextureUnitState::removeAllEffects
void removeAllEffects(void)
Removes all effects applied to this texture layer.
Ogre::TextureUnitState::BindingType
BindingType
The type of unit to bind the texture settings to.
Definition: OgreTextureUnitState.h:469
Ogre::TextureUnitState::_notifyParent
void _notifyParent(Pass *parent)
Notify this object that its parent has changed.
Ogre::TextureUnitState::isTextureLoadFailing
bool isTextureLoadFailing() const
Tests if the texture associated with this unit has failed to load.
Definition: OgreTextureUnitState.h:1042
Ogre::TextureUnitState::_unload
void _unload(void)
Internal method for unloading this object as part of Material::unload.
Ogre::set
Definition: OgrePrerequisites.h:520
Ogre::TextureUnitState::deleteFrameTextureName
void deleteFrameTextureName(const size_t frameNumber)
Deletes a specific texture frame.
Ogre::TextureUnitState::setTextureMipmapBias
void setTextureMipmapBias(float bias)
Sets the bias value applied to the mipmap calculation.
Definition: OgreTextureUnitState.h:1116
Ogre::TextureUnitState::addFrameTextureName
void addFrameTextureName(const String &name)
Add a Texture name to the end of the frame container.
Ogre::TextureUnitState::mAlphaBlendMode
LayerBlendModeEx mAlphaBlendMode
Definition: OgreTextureUnitState.h:1234
Ogre::TextureUnitState::mTextureLoadFailed
bool mTextureLoadFailed
Definition: OgreTextureUnitState.h:1235
Ogre::TextureUnitState::mAnimDuration
Real mAnimDuration
Duration of animation in seconds.
Definition: OgreTextureUnitState.h:1219
Ogre::TextureUnitState::mGamma
Real mGamma
Definition: OgreTextureUnitState.h:1238
Ogre::TextureUnitState::TT_TRANSLATE_V
@ TT_TRANSLATE_V
Definition: OgreTextureUnitState.h:115
Ogre::TextureUnitState::mMinFilter
FilterOptions mMinFilter
Texture filtering - minification.
Definition: OgreTextureUnitState.h:1247
Ogre::TextureUnitState::mTextureSrcMipmaps
int mTextureSrcMipmaps
Definition: OgreTextureUnitState.h:1224
Ogre::TextureUnitState::getTextureAddressingMode
const UVWAddressingMode & getTextureAddressingMode(void) const
Gets the texture addressing mode for a given coordinate, i.e.
Ogre::TextureUnitState::_unprepare
void _unprepare(void)
Internal method for undoing the preparation this object as part of Material::unprepare.
Ogre::TextureUnitState::TextureUnitState
TextureUnitState(Pass *parent)
Default constructor.
Ogre::LayerBlendSource
LayerBlendSource
List of valid sources of values for blending operations used in TextureUnitState::setColourOperation ...
Definition: OgreBlendMode.h:113
Ogre::TextureUnitState::isLoaded
bool isLoaded(void) const
Is this loaded?
Ogre::TextureUnitState::getTextureNameAlias
const String & getTextureNameAlias(void) const
Gets the Texture Name Alias of the Texture Unit.
Definition: OgreTextureUnitState.h:1176
Ogre::TextureUnitState::_getTexturePtr
const TexturePtr & _getTexturePtr(void) const
Get the texture pointer for the current frame.
Ogre::TextureUnitState::getTextureAnisotropy
unsigned int getTextureAnisotropy() const
Get this layer texture anisotropy level.
Ogre::TextureUnitState::setProjectiveTexturing
void setProjectiveTexturing(bool enabled, const Frustum *projectionSettings=0)
Enables or disables projective texturing on this texture unit.
Ogre::TextureUnitState::getDesiredFormat
PixelFormat getDesiredFormat(void) const
Gets the desired pixel format when load the texture.
Ogre::TextureUnitState::setTextureNameAlias
void setTextureNameAlias(const String &name)
Set the alias name used for texture frame names.
Ogre::TextureUnitState::getTextureCompareEnabled
bool getTextureCompareEnabled() const
Ogre::TextureUnitState::mCompositorRefName
String mCompositorRefName
The data that references the compositor.
Definition: OgreTextureUnitState.h:1280
Ogre::TextureUnitState::ENV_PLANAR
@ ENV_PLANAR
Envmap based on vector from camera to vertex position, good for planar geometry.
Definition: OgreTextureUnitState.h:98
Ogre::TextureUnitState::ensurePrepared
void ensurePrepared(size_t frame) const
Internal method for ensuring the texture for a given frame is prepared.
Ogre::TextureUnitState::mIsDefaultFiltering
bool mIsDefaultFiltering
Definition: OgreTextureUnitState.h:1262
Ogre::TextureUnitState::mMipmapBias
float mMipmapBias
Mipmap bias (always float, not Real).
Definition: OgreTextureUnitState.h:1259
Ogre::TextureUnitState::getTextureTransform
const Matrix4 & getTextureTransform(void) const
Gets the current texture transformation matrix.
Ogre::TextureUnitState::getTextureCoordSet
unsigned int getTextureCoordSet(void) const
Gets the index of the set of texture co-ords this layer uses.
Ogre::TextureUnitState::setTextureAddressingMode
void setTextureAddressingMode(TextureAddressingMode tam)
Sets the texture addressing mode, i.e.
Ogre::LBS_TEXTURE
@ LBS_TEXTURE
the colour derived from the texture assigned to this layer
Definition: OgreBlendMode.h:117
Ogre::TextureUnitState::setAlphaOperation
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.
Ogre::TextureFilterOptions
TextureFilterOptions
High-level filtering options providing shortcuts to settings the minification, magnification and mip ...
Definition: OgreCommon.h:79
Ogre::TextureUnitState::getCurrentFrame
unsigned int getCurrentFrame(void) const
Gets the active frame in an animated or multi-image texture layer.
Ogre::WaveformType
WaveformType
Enumerates the wave types usable with the Ogre engine.
Definition: OgreCommon.h:162
Ogre::TextureUnitState::retryTextureLoad
void retryTextureLoad()
Tells the unit to retry loading the texture if it had failed to load.
Definition: OgreTextureUnitState.h:1046
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::TextureUnitState::isCubic
bool isCubic(void) const
Returns true if this texture unit is either a series of 6 2D textures, each in it's own frame,...
Ogre::TextureUnitState::mMipFilter
FilterOptions mMipFilter
Texture filtering - mipmapping.
Definition: OgreTextureUnitState.h:1251
Ogre::TextureUnitState::mVScale
Real mVScale
Definition: OgreTextureUnitState.h:1242
Ogre::TextureUnitState::getTextureDimensions
std::pair< size_t, size_t > getTextureDimensions(unsigned int frame=0) const
Returns the width and height of the texture in the given frame.
Ogre::Pass
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:81
Ogre::TextureUnitState::mDesiredFormat
PixelFormat mDesiredFormat
Definition: OgreTextureUnitState.h:1223
Ogre::TextureUnitState::is3D
bool is3D(void) const
Returns true if this texture layer uses a composite 3D cubic texture.
Ogre::TextureUnitState::getContentType
ContentType getContentType(void) const
Get the type of content this TextureUnitState references.
Ogre::LayerBlendModeEx
Class which manages blending of both colour and alpha components.
Definition: OgreBlendMode.h:140
Ogre::TextureUnitState::mBindingType
BindingType mBindingType
Binding type (fragment or vertex pipeline).
Definition: OgreTextureUnitState.h:1264
Ogre::TextureUnitState::setAnimatedTextureName
void setAnimatedTextureName(const String &name, unsigned int numFrames, Real duration=0)
Sets the names of the texture images for an animated texture.
Ogre::TextureUnitState::TAM_MIRROR
@ TAM_MIRROR
Texture mirrors (flips) at joins over 1.0.
Definition: OgreTextureUnitState.h:131
Ogre::TextureUnitState::setTextureUScale
void setTextureUScale(Real value)
As setTextureScale, but sets only U value.
Ogre::TextureUnitState::setColourOpMultipassFallback
void setColourOpMultipassFallback(const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor)
Sets the multipass fallback operation for this layer, if you used TextureUnitState::setColourOperatio...
Ogre::TextureUnitState::setTextureAddressingMode
void setTextureAddressingMode(TextureAddressingMode u, TextureAddressingMode v, TextureAddressingMode w)
Sets the texture addressing mode, i.e.
Ogre::CompareFunction
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:65
Ogre::TextureUnitState::TextureEffect::waveType
WaveformType waveType
Definition: OgreTextureUnitState.h:164
Ogre::TextureUnitState::TextureEffect::amplitude
Real amplitude
Definition: OgreTextureUnitState.h:168
Ogre::TextureUnitState::mMaxAniso
unsigned int mMaxAniso
Texture anisotropy.
Definition: OgreTextureUnitState.h:1257
Ogre::TextureUnitState::UVWAddressingMode::w
TextureAddressingMode w
Definition: OgreTextureUnitState.h:143
Ogre::TextureUnitState::setTextureFiltering
void setTextureFiltering(TextureFilterOptions filterType)
Set the texture filtering for this unit, using the simplified interface.
Ogre::TextureUnitState::setCubicTexture
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...
Ogre::TextureUnitState::mCompareEnabled
bool mCompareEnabled
Definition: OgreTextureUnitState.h:1253
Ogre::TextureUnitState::getAlphaBlendMode
const LayerBlendModeEx & getAlphaBlendMode(void) const
Get multitexturing alpha blending mode.
Ogre::TextureUnitState::calculateSize
size_t calculateSize(void) const
Ogre::TextureUnitState::TextureUnitState
TextureUnitState(Pass *parent, const TextureUnitState &oth)
Ogre::TextureUnitState::setBindingType
void setBindingType(BindingType bt)
Sets the type of unit these texture settings should be bound to.
Ogre::TextureUnitState::getTextureCompareFunction
CompareFunction getTextureCompareFunction() const
Ogre::Controller< Real >
Ogre::TextureUnitState::isHardwareGammaEnabled
bool isHardwareGammaEnabled() const
Gets whether this texture will be set up so that on sampling it, hardware gamma correction is applied...
OgreHeaderPrefix.h
Ogre::TextureUnitState::setTextureFiltering
void setTextureFiltering(FilterType ftype, FilterOptions opts)
Set a single filtering option on this texture unit.
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
Ogre::TextureUnitState::mCompareFunc
CompareFunction mCompareFunc
Definition: OgreTextureUnitState.h:1254
Ogre::TextureUnitState::getTextureRotate
const Radian & getTextureRotate(void) const
Get texture rotation effects angle value.
Ogre::SceneBlendFactor
SceneBlendFactor
Blending factors for manually blending objects with the scene.
Definition: OgreBlendMode.h:235
Ogre::PixelFormat
PixelFormat
The pixel format used for images, textures, and render surfaces.
Definition: OgrePixelFormat.h:44
Ogre::TextureUnitState::ENV_CURVED
@ ENV_CURVED
Envmap based on dot of vector from camera to vertex and vertex normal, good for curves.
Definition: OgreTextureUnitState.h:100
OgrePrerequisites.h
Ogre::TextureUnitState::getBindingType
BindingType getBindingType(void) const
Gets the type of unit these texture settings should be bound to.
Ogre::TextureUnitState::mAnimController
Controller< Real > * mAnimController
Definition: OgreTextureUnitState.h:1289
OgreTexture.h
Ogre::TextureUnitState::TT_SCALE_U
@ TT_SCALE_U
Definition: OgreTextureUnitState.h:116
Ogre::TextureUnitState::recalcTextureMatrix
void recalcTextureMatrix(void) const
Internal method for calculating texture matrix.
Ogre::TextureUnitState::setTransformAnimation
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.
Ogre::TextureUnitState::mFramePtrs
vector< TexturePtr >::type mFramePtrs
Definition: OgreTextureUnitState.h:1275
Ogre::TextureUnitState::isBlank
bool isBlank(void) const
Determines if this texture layer is currently blank.
Ogre::TextureUnitState::ContentType
ContentType
Enum identifying the type of content this texture unit contains.
Definition: OgreTextureUnitState.h:488
Ogre::TextureUnitState::ET_PROJECTIVE_TEXTURE
@ ET_PROJECTIVE_TEXTURE
Generate texture coords based on a frustum.
Definition: OgreTextureUnitState.h:76
Ogre::TextureUnitState::_prepare
void _prepare(void)
Internal method for preparing this object for load, as part of Material::prepare.
Ogre::TextureUnitState::mTexModMatrix
Matrix4 mTexModMatrix
Definition: OgreTextureUnitState.h:1244
Ogre::AliasTextureNamePairList
map< String, String >::type AliasTextureNamePairList
Alias / Texture name pair (first = alias, second = texture name)
Definition: OgreCommon.h:553
Ogre::TextureUnitState::TextureUnitState
TextureUnitState(Pass *parent, const String &texName, unsigned int texCoordSet=0)
Name-based constructor.
Ogre::TextureUnitState::setCubicTextureName
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...
Ogre::TextureUnitState::mTextureType
TextureType mTextureType
Is this a series of 6 2D textures to make up a cube?
Definition: OgreTextureUnitState.h:1222
Ogre::TextureUnitState::mCompositorRefMrtIndex
size_t mCompositorRefMrtIndex
The index of the referenced texture if referencing an MRT in a compositor.
Definition: OgreTextureUnitState.h:1268
Ogre::FilterOptions
FilterOptions
Filtering options for textures / mipmaps.
Definition: OgreCommon.h:101
Ogre::Radian
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:48
Ogre::TextureUnitState::TextureEffectType
TextureEffectType
Definition of the broad types of texture effect you can apply to a texture unit.
Definition: OgreTextureUnitState.h:72
Ogre::TextureUnitState::TT_TRANSLATE_U
@ TT_TRANSLATE_U
Definition: OgreTextureUnitState.h:114
Ogre::TextureUnitState::TextureEffect::base
Real base
Definition: OgreTextureUnitState.h:165
Ogre::TextureUnitState::mMagFilter
FilterOptions mMagFilter
Texture filtering - magnification.
Definition: OgreTextureUnitState.h:1249
Ogre::TextureUnitState::getColourBlendFallbackSrc
SceneBlendFactor getColourBlendFallbackSrc(void) const
Get the multipass fallback for colour blending operation source factor.
Ogre::TextureUnitState::ET_UVSCROLL
@ ET_UVSCROLL
Constant u/v scrolling effect.
Definition: OgreTextureUnitState.h:78
Ogre::TextureUnitState::setHardwareGammaEnabled
void setHardwareGammaEnabled(bool enabled)
Sets whether this texture will be set up so that on sampling it, hardware gamma correction is applied...
Ogre::TextureUnitState::getEffects
const EffectMap & getEffects(void) const
Get texture effects in a multimap paired array.
Ogre::TextureUnitState::mCompositorRefTexName
String mCompositorRefTexName
Definition: OgreTextureUnitState.h:1281
Ogre::TextureUnitState::setCompositorReference
void setCompositorReference(const String &compositorName, const String &textureName, size_t mrtIndex=0)
Set the compositor reference for this texture unit state.
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::TextureUnitState::setTextureCompareEnabled
void setTextureCompareEnabled(bool enabled)
Ogre::TextureUnitState::mRotate
Radian mRotate
Definition: OgreTextureUnitState.h:1243
OgreCommon.h
Ogre::TextureUnitState::TextureEffect::frustum
const Frustum * frustum
Definition: OgreTextureUnitState.h:170
Ogre::TextureUnitState::setCubicTextureName
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...
Ogre::TextureUnitState::hasViewRelativeTextureCoordinateGeneration
bool hasViewRelativeTextureCoordinateGeneration(void) const
Returns whether this unit has texture coordinate generation that depends on the camera.
Ogre::TextureUnitState::setBlank
void setBlank(void)
Sets this texture layer to be blank.
Ogre::TextureUnitState::setNumMipmaps
void setNumMipmaps(int numMipmaps)
Sets how many mipmaps have been requested for the texture.
Ogre::TextureUnitState::getAnimationDuration
Real getAnimationDuration(void) const
Get the animated-texture animation duration.
Ogre::TextureUnitState::setColourOperation
void setColourOperation(const LayerBlendOperation op)
Determines how this texture layer is combined with the one below it (or the diffuse colour of the geo...
Ogre::LayerBlendOperation
LayerBlendOperation
List of valid texture blending operations, for use with TextureUnitState::setColourOperation.
Definition: OgreBlendMode.h:57
Ogre::TextureUnitState::getReferencedTextureName
const String & getReferencedTextureName() const
Gets the name of the texture in the compositor that this texture references.
Definition: OgreTextureUnitState.h:1137
Ogre::TextureUnitState::getTextureMipmapBias
float getTextureMipmapBias(void) const
Gets the bias value applied to the mipmap calculation.
Definition: OgreTextureUnitState.h:1120
Ogre::TextureUnitState::mContentType
ContentType mContentType
Content type of texture (normal loaded texture, auto-texture).
Definition: OgreTextureUnitState.h:1266
Ogre::TextureUnitState::_getTexturePtr
const TexturePtr & _getTexturePtr(size_t frame) const
Get the texture pointer for a given frame.
Ogre::TextureUnitState::~TextureUnitState
~TextureUnitState()
Default destructor.
Ogre::TextureUnitState::getName
const String & getName(void) const
Get the name of the Texture Unit State.
Definition: OgreTextureUnitState.h:1167
Ogre::TextureUnitState::setAnimatedTextureName
void setAnimatedTextureName(const String *const names, unsigned int numFrames, Real duration=0)
Sets the names of the texture images for an animated texture.
Ogre::ColourValue::White
static const ColourValue White
Definition: OgreColourValue.h:62
Ogre::Frustum
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Definition: OgreFrustum.h:86
Ogre::multimap
Definition: OgrePrerequisites.h:548
Ogre::TextureUnitState::setTextureName
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.
Ogre::TextureUnitState::setFrameTextureName
void setFrameTextureName(const String &name, unsigned int frameNumber)
Sets the name of the texture associated with a frame.
Ogre::TextureUnitState::setEnvironmentMap
void setEnvironmentMap(bool enable, EnvMapType envMapType=ENV_CURVED)
Turns on/off texture coordinate effect that makes this layer an environment map.
Ogre::SharedPtr< Texture >
Ogre::TextureUnitState::getNumFrames
unsigned int getNumFrames(void) const
Gets the number of frames for a texture.
Ogre::TextureUnitState::mBorderColour
ColourValue mBorderColour
Definition: OgreTextureUnitState.h:1228
Ogre::TextureUnitState::TAM_CLAMP
@ TAM_CLAMP
Texture clamps at 1.0.
Definition: OgreTextureUnitState.h:133
OgreIteratorWrappers.h
Ogre::TextureUnitState::TextureTransformType
TextureTransformType
Useful enumeration when dealing with procedural transforms.
Definition: OgreTextureUnitState.h:113
Ogre::TextureUnitState::setTextureCompareFunction
void setTextureCompareFunction(CompareFunction function)
Ogre::TextureUnitState::setTextureFiltering
void setTextureFiltering(FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter)
Set a the detailed filtering options on this texture unit.
Ogre::TextureUnitState::applyTextureAliases
bool applyTextureAliases(const AliasTextureNamePairList &aliasList, const bool apply=true)
Applies texture names to Texture Unit State with matching texture name aliases.
Ogre::TextureUnitState::ET_ENVIRONMENT_MAP
@ ET_ENVIRONMENT_MAP
Generate all texture coords based on angle between camera and vertex.
Definition: OgreTextureUnitState.h:74
Ogre::TextureUnitState::setTextureAnisotropy
void setTextureAnisotropy(unsigned int maxAniso)
Sets the anisotropy level to be used for this texture level.
OgreBlendMode.h
Ogre::TextureUnitState::ensureLoaded
void ensureLoaded(size_t frame) const
Internal method for ensuring the texture for a given frame is loaded.
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:58
Ogre::TextureUnitState::mTextureCoordSetIndex
unsigned int mTextureCoordSetIndex
Request number of mipmaps.
Definition: OgreTextureUnitState.h:1226
Ogre::TextureUnitState::setTextureVScale
void setTextureVScale(Real value)
As setTextureScale, but sets only V value.
OgreMatrix4.h
Ogre::TextureUnitState::mVMod
Real mVMod
Definition: OgreTextureUnitState.h:1241
Ogre::TextureUnitState::setTextureScroll
void setTextureScroll(Real u, Real v)
Sets the translation offset of the texture, ie scrolls the texture.
Ogre::TextureUnitState::_setTexturePtr
void _setTexturePtr(const TexturePtr &texptr, size_t frame)
Set the texture pointer for a given frame (internal use only!).
Ogre::TextureUnitState::setName
void setName(const String &name)
Set the name of the Texture Unit State.
Ogre::TextureUnitState::getTextureVScroll
Real getTextureVScroll(void) const
Get texture vscroll value.
Ogre::LBS_CURRENT
@ LBS_CURRENT
the colour as built up from previous stages
Definition: OgreBlendMode.h:115
Ogre::TextureUnitState::getIsAlpha
bool getIsAlpha(void) const
Gets whether this texture is requested to be loaded as alpha if single channel.
Ogre::TextureUnitState::ENV_REFLECTION
@ ENV_REFLECTION
Envmap intended to supply reflection vectors for cube mapping.
Definition: OgreTextureUnitState.h:102
Ogre::TextureUnitState::addEffect
void addEffect(TextureEffect &effect)
Generic method for setting up texture effects.
Ogre::TextureUnitState::setDesiredFormat
void setDesiredFormat(PixelFormat desiredFormat)
Sets the desired pixel format when load the texture.
Ogre::TextureUnitState::TextureEffect::type
TextureEffectType type
Definition: OgreTextureUnitState.h:161
Ogre::TextureUnitState::mCubic
bool mCubic
Definition: OgreTextureUnitState.h:1220
Ogre::TextureUnitState::ET_USCROLL
@ ET_USCROLL
Constant u scrolling effect.
Definition: OgreTextureUnitState.h:80
Ogre::TextureUnitState::setTextureVScroll
void setTextureVScroll(Real value)
As setTextureScroll, but sets only V value.
Ogre::TextureUnitState::UVWAddressingMode
Texture addressing mode for each texture coordinate.
Definition: OgreTextureUnitState.h:142
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::TextureUnitState::mName
String mName
Optional name for the TUS.
Definition: OgreTextureUnitState.h:1276
Ogre::TextureUnitState::setColourOperationEx
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.
Ogre::TextureUnitState::TextureCubeFace
TextureCubeFace
Enum identifying the frame indexes for faces of a cube map (not the composite 3D type.
Definition: OgreTextureUnitState.h:149
Ogre::TextureUnitState::TAM_WRAP
@ TAM_WRAP
Texture wraps at values over 1.0.
Definition: OgreTextureUnitState.h:129
Ogre::LayerBlendOperationEx
LayerBlendOperationEx
Expert list of valid texture blending operations, for use with TextureUnitState::setColourOperationEx...
Definition: OgreBlendMode.h:75
Ogre::TextureUnitState::mFrames
vector< String >::type mFrames
Definition: OgreTextureUnitState.h:1274
Ogre::TextureUnitState::_load
void _load(void)
Internal method for loading this object as part of Material::load.
Ogre::TextureType
TextureType
Enum identifying the texture type.
Definition: OgreTexture.h:68
Ogre::TextureUnitState::TextureEffect::phase
Real phase
Definition: OgreTextureUnitState.h:167
Ogre::TextureUnitState::setGamma
void setGamma(Real gamma)
Sets the gamma adjustment factor applied to this texture on loading the data.
Definition: OgreTextureUnitState.h:568
Ogre::TextureUnitState::setTextureUScroll
void setTextureUScroll(Real value)
As setTextureScroll, but sets only U value.
Ogre::TextureUnitState::getNumMipmaps
int getNumMipmaps(void) const
Gets how many mipmaps have been requested for the texture.
Ogre::TextureUnitState::setIsAlpha
void setIsAlpha(bool isAlpha)
Sets whether this texture is requested to be loaded as alpha if single channel.
Ogre::TextureUnitState::removeEffect
void removeEffect(const TextureEffectType type)
Removes a single effect applied to this texture layer.
Ogre::TextureUnitState::setScrollAnimation
void setScrollAnimation(Real uSpeed, Real vSpeed)
Sets up an animated scroll for the texture layer.
Ogre::TextureUnitState::getColourBlendMode
const LayerBlendModeEx & getColourBlendMode(void) const
Get multitexturing colour blending mode.
Ogre::TextureUnitState::mIsDefaultAniso
bool mIsDefaultAniso
Definition: OgreTextureUnitState.h:1261
Ogre::TextureUnitState::setTextureBorderColour
void setTextureBorderColour(const ColourValue &colour)
Sets the texture border colour.
Ogre::TextureUnitState::TT_SCALE_V
@ TT_SCALE_V
Definition: OgreTextureUnitState.h:117
Ogre::TextureUnitState::setRotateAnimation
void setRotateAnimation(Real speed)
Sets up an animated texture rotation for this layer.
Ogre::TextureUnitState::getFrameTextureName
const String & getFrameTextureName(unsigned int frameNumber) const
Gets the name of the texture associated with a frame number.
OgreString.h
Ogre::TextureUnitState::getReferencedCompositorName
const String & getReferencedCompositorName() const
Gets the name of the compositor that this texture referneces.
Definition: OgreTextureUnitState.h:1135
Ogre::TextureUnitState::mColourBlendFallbackSrc
SceneBlendFactor mColourBlendFallbackSrc
Definition: OgreTextureUnitState.h:1231
Ogre::vector
Definition: OgrePrerequisites.h:492
Ogre::TextureUnitState::TextureEffect::controller
Controller< Real > * controller
Definition: OgreTextureUnitState.h:169
Ogre::TextureUnitState::EffectMap
multimap< TextureEffectType, TextureEffect >::type EffectMap
Texture effects in a multimap paired array.
Definition: OgreTextureUnitState.h:175
Ogre::TextureUnitState::mParent
Pass * mParent
Definition: OgreTextureUnitState.h:1288
Ogre::TextureUnitState::setTextureAddressingMode
void setTextureAddressingMode(const UVWAddressingMode &uvw)
Sets the texture addressing mode, i.e.
Ogre::TextureUnitState::getReferencedMRTIndex
size_t getReferencedMRTIndex() const
Gets the MRT index of the texture in the compositor that this texture references.
Definition: OgreTextureUnitState.h:1139
Ogre::TextureUnitState::getTextureType
TextureType getTextureType(void) const
Returns the type of this texture.
Ogre::TextureUnitState::setTextureTransform
void setTextureTransform(const Matrix4 &xform)
Sets a matrix used to transform any texture coordinates on this layer.
Ogre::TextureUnitState::mColourBlendFallbackDest
SceneBlendFactor mColourBlendFallbackDest
Definition: OgreTextureUnitState.h:1232
Ogre::TEX_TYPE_2D
@ TEX_TYPE_2D
2D texture, used in combination with 2D texture coordinates (default)
Definition: OgreTexture.h:72
Ogre::TextureUnitState::_setTexturePtr
void _setTexturePtr(const TexturePtr &texptr)
Set the texture pointer for the current frame (internal use only!).
Ogre::TextureUnitState::mEffects
EffectMap mEffects
Definition: OgreTextureUnitState.h:1278
Ogre::FilterType
FilterType
Definition: OgreCommon.h:91
Ogre::TextureUnitState::_getAnimController
Controller< Real > * _getAnimController() const
Gets the animation controller (as created because of setAnimatedTexture) if it exists.
Definition: OgreTextureUnitState.h:1212
Ogre::TextureUnitState::mTextureNameAlias
String mTextureNameAlias
Optional alias for texture frames.
Definition: OgreTextureUnitState.h:1277
Ogre::TextureUnitState::mIsAlpha
bool mIsAlpha
Definition: OgreTextureUnitState.h:1236
Ogre::TextureUnitState::_notifyNeedsRecompile
void _notifyNeedsRecompile(void)
Tells the class that it needs recompilation.
Ogre::TextureUnitState::mCurrentFrame
unsigned int mCurrentFrame
The current animation frame.
Definition: OgreTextureUnitState.h:1216
Ogre::TextureUnitState::getGamma
Real getGamma() const
Returns the gamma adjustment factor applied to this texture on loading.
Definition: OgreTextureUnitState.h:566
Ogre::TextureUnitState::setTextureScale
void setTextureScale(Real uScale, Real vScale)
Sets the scaling factor applied to texture coordinates.
Ogre::TextureUnitState::mColourBlendMode
LayerBlendModeEx mColourBlendMode
Definition: OgreTextureUnitState.h:1230
Ogre::TextureUnitState::EnvMapType
EnvMapType
Enumeration to specify type of envmap.
Definition: OgreTextureUnitState.h:96
Ogre::TextureUnitState::ET_ROTATE
@ ET_ROTATE
Constant rotation.
Definition: OgreTextureUnitState.h:84
Ogre::TextureUnitState::TextureEffect::subtype
int subtype
Definition: OgreTextureUnitState.h:162
Ogre::TextureUnitState::TextureEffect
Internal structure defining a texture effect.
Definition: OgreTextureUnitState.h:160
Ogre::TextureUnitState::ET_VSCROLL
@ ET_VSCROLL
Constant u/v scrolling effect.
Definition: OgreTextureUnitState.h:82
Ogre::TextureUnitState::setTexture
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
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.