OGRE 14.3
Object-Oriented Graphics Rendering Engine
|
Class which determines how a TextureUnitState accesses data from a Texture. More...
#include <OgreTextureUnitState.h>
Classes | |
struct | UVWAddressingMode |
Texture addressing mode for each texture coordinate. More... | |
Public Member Functions | |
Sampler () | |
must be created through TextureManager | |
virtual | ~Sampler () |
const UVWAddressingMode & | getAddressingMode () const |
Gets the texture addressing mode for a given coordinate, i.e. | |
unsigned int | getAnisotropy () const |
Get this layer texture anisotropy level. | |
const ColourValue & | getBorderColour (void) const |
bool | getCompareEnabled () const |
CompareFunction | getCompareFunction () const |
FilterOptions | getFiltering (FilterType ftype) const |
Get the texture filtering for the given type. | |
float | getMipmapBias (void) const |
Gets the bias value applied to the mipmap calculation. | |
void | setAddressingMode (const UVWAddressingMode &uvw) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | setAddressingMode (TextureAddressingMode tam) |
Sets the texture addressing mode, i.e. | |
void | setAddressingMode (TextureAddressingMode u, TextureAddressingMode v, TextureAddressingMode w) |
Sets the texture addressing mode, i.e. | |
void | setAnisotropy (unsigned int maxAniso) |
Sets the anisotropy level to be used for this texture level. | |
void | setBorderColour (const ColourValue &colour) |
Sets the texture border colour. | |
void | setCompareEnabled (bool enabled) |
Enables or disables the comparison test for depth textures. | |
void | setCompareFunction (CompareFunction function) |
void | setFiltering (FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter) |
Set a the detailed filtering options on this texture unit. | |
void | setFiltering (FilterType ftype, FilterOptions opts) |
Set a single filtering option on this texture unit. | |
void | setFiltering (TextureFilterOptions filterType) |
Set the texture filtering for this unit, using the simplified interface. | |
void | setMipmapBias (float bias) |
Sets the bias value applied to the mipmap calculation. | |
Class which determines how a TextureUnitState accesses data from a Texture.
There are a number of parameters affecting how texture data is fetched. Most notably FilterOptions and TextureAddressingMode.
Ogre::Sampler::Sampler | ( | ) |
must be created through TextureManager
|
virtual |
void Ogre::Sampler::setFiltering | ( | TextureFilterOptions | filterType | ) |
Set the texture filtering for this unit, using the simplified interface.
You also have the option of specifying the minification, magnification and mip filter individually if you want more control over filtering options. See the alternative setTextureFiltering methods for details.
filterType | The high-level filter type to use. |
void Ogre::Sampler::setFiltering | ( | FilterType | ftype, |
FilterOptions | opts | ||
) |
Set a single filtering option on this texture unit.
ftype | The filtering type to set. |
opts | The filtering option to set. |
void Ogre::Sampler::setFiltering | ( | FilterOptions | minFilter, |
FilterOptions | magFilter, | ||
FilterOptions | mipFilter | ||
) |
Set a the detailed filtering options on this texture unit.
minFilter | The filtering to use when reducing the size of the texture. Can be Ogre::FO_POINT, Ogre::FO_LINEAR or Ogre::FO_ANISOTROPIC. |
magFilter | The filtering to use when increasing the size of the texture. Can be Ogre::FO_POINT, Ogre::FO_LINEAR or Ogre::FO_ANISOTROPIC. |
mipFilter | The filtering to use between mip levels. Can be Ogre::FO_NONE (turns off mipmapping), Ogre::FO_POINT or Ogre::FO_LINEAR (trilinear filtering). |
FilterOptions Ogre::Sampler::getFiltering | ( | FilterType | ftype | ) | const |
Get the texture filtering for the given type.
|
inline |
Gets the texture addressing mode for a given coordinate, i.e.
what happens at uv values above 1.0.
|
inline |
Sets the texture addressing mode, i.e.
what happens at uv values above 1.0.
The default is TAM_WRAP i.e. the texture repeats over values of 1.0. This is a shortcut method which sets the addressing mode for all coordinates at once; you can also call the more specific method to set the addressing mode per coordinate.
This is a shortcut method which sets the addressing mode for all coordinates at once; you can also call the more specific method to set the addressing mode per coordinate.
References setAddressingMode().
Referenced by setAddressingMode().
|
inline |
Sets the texture addressing mode, i.e.
what happens at uv values above 1.0.
The default is TAM_WRAP i.e. the texture repeats over values of 1.0.
void Ogre::Sampler::setAddressingMode | ( | const UVWAddressingMode & | uvw | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Sets the anisotropy level to be used for this texture level.
The degree of anisotropy is the ratio between the height of the texture segment visible in a screen space region versus the width - so for example a floor plane, which stretches on into the distance and thus the vertical texture coordinates change much faster than the horizontal ones, has a higher anisotropy than a wall which is facing you head on (which has an anisotropy of 1 if your line of sight is perfectly perpendicular to it).The maximum value is determined by the hardware, but it is usually 8 or 16.
In order for this to be used, you have to set the minification and/or the magnification option on this texture to Ogre::FO_ANISOTROPIC.
maxAniso | The maximal anisotropy level, should be between 2 and the maximum supported by hardware (1 is the default, ie. no anisotropy). |
Sets the bias value applied to the mipmap calculation.
You can alter the mipmap calculation by biasing the result with a single floating point value. After the mip level has been calculated, this bias value is added to the result to give the final mip level. Lower mip levels are larger (higher detail), so a negative bias will force the larger mip levels to be used, and a positive bias will cause smaller mip levels to be used. The bias values are in mip levels, so a -1 bias will force mip levels one larger than by the default calculation.
In order for this option to be used, your hardware has to support mipmap biasing (exposed through Ogre::RSC_MIPMAP_LOD_BIAS), and your minification filtering has to be set to point or linear.
Gets the bias value applied to the mipmap calculation.
Enables or disables the comparison test for depth textures.
When enabled, sampling the texture returns how the sampled value compares against a reference value instead of the sampled value itself. Combined with linear filtering this can be used to implement hardware PCF for shadow maps.
|
inline |
|
inline |
|
inline |
|
inline |
Sets the texture border colour.
The default is ColourValue::Black, and this value only used when addressing mode is TAM_BORDER.
|
inline |