Changed the support for anisotropic filtering in osg::Texture so that it

is now controlled via the setMaxAnisotropy(float) method, and is set up
independently for the mag filter mode, which it previously was done.
This commit is contained in:
Robert Osfield
2002-08-07 15:52:24 +00:00
parent 0bee7dd3d9
commit b9b013e15b
7 changed files with 69 additions and 50 deletions

View File

@@ -165,7 +165,6 @@ class SG_EXPORT Texture : public StateAttribute
NEAREST = GL_NEAREST,
NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR,
NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST,
ANISOTROPIC = GL_TEXTURE_MAX_ANISOTROPY_EXT
};
@@ -175,6 +174,15 @@ class SG_EXPORT Texture : public StateAttribute
/** Get the texture filter mode.*/
const FilterMode getFilter(const FilterParameter which) const;
/** Set the maximum anisotropy value, default value is 1.0 for
* no anisotropic filtering. If hardware does not support anisotropic
* filtering then normal filtering is used, equivilant to a max anisotropy value of 1.0.
* valid range is 1.0f upwards. The maximum value depends on the graphics
* system being used.*/
inline void setMaxAnisotropy(float anis);
/** Get the maximum anisotropy value.*/
inline float getMaxAnisotropy() const { return _maxAnisotropy; }
enum InternalFormatMode {
USE_IMAGE_DATA_FORMAT,
@@ -361,8 +369,9 @@ class SG_EXPORT Texture : public StateAttribute
WrapMode _wrap_t;
WrapMode _wrap_r;
FilterMode _min_filter;
FilterMode _mag_filter;
FilterMode _min_filter;
FilterMode _mag_filter;
float _maxAnisotropy;
// true if apply tex parameters required.
mutable bool _texParamtersDirty;