Class which determines how a TextureUnitState accesses data from a Texture.
More...
#include <OgreTextureUnitState.h>
Class which determines how a TextureUnitState accesses data from a Texture.
There are a number of parameters affecting how texture data is featched. Most notably FilterOptions and TextureAddressingMode.
◆ Sampler()
Ogre::Sampler::Sampler |
( |
| ) |
|
◆ ~Sampler()
virtual Ogre::Sampler::~Sampler |
( |
| ) |
|
|
virtual |
◆ setFiltering() [1/3]
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.
- Parameters
-
filterType | The high-level filter type to use. |
◆ setFiltering() [2/3]
Set a single filtering option on this texture unit.
- Parameters
-
ftype | The filtering type to set. |
opts | The filtering option to set. |
◆ setFiltering() [3/3]
Set a the detailed filtering options on this texture unit.
- Parameters
-
◆ getFiltering()
Get the texture filtering for the given type.
◆ getAddressingMode()
Gets the texture addressing mode for a given coordinate, i.e.
what happens at uv values above 1.0.
- Note
- The default is TAM_WRAP i.e. the texture repeats over values of 1.0.
◆ setAddressingMode() [1/3]
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().
◆ setAddressingMode() [2/3]
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.
◆ setAddressingMode() [3/3]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ setAnisotropy()
void Ogre::Sampler::setAnisotropy |
( |
unsigned int |
maxAniso | ) |
|
|
inline |
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.
- Parameters
-
maxAniso | The maximal anisotropy level, should be between 2 and the maximum supported by hardware (1 is the default, ie. no anisotrophy). |
◆ getAnisotropy()
unsigned int Ogre::Sampler::getAnisotropy |
( |
| ) |
const |
|
inline |
Get this layer texture anisotropy level.
◆ setMipmapBias()
void Ogre::Sampler::setMipmapBias |
( |
float |
bias | ) |
|
|
inline |
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.
◆ getMipmapBias()
float Ogre::Sampler::getMipmapBias |
( |
void |
| ) |
const |
|
inline |
◆ setCompareEnabled()
void Ogre::Sampler::setCompareEnabled |
( |
bool |
enabled | ) |
|
|
inline |
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.
◆ getCompareEnabled()
bool Ogre::Sampler::getCompareEnabled |
( |
| ) |
const |
|
inline |
◆ setCompareFunction()
◆ getCompareFunction()
◆ setBorderColour()
void Ogre::Sampler::setBorderColour |
( |
const ColourValue & |
colour | ) |
|
|
inline |
Sets the texture border colour.
The default is ColourValue::Black, and this value only used when addressing mode is TAM_BORDER.
◆ getBorderColour()
const ColourValue& Ogre::Sampler::getBorderColour |
( |
void |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: