add static helper func in order to generate Samplers of a Samplerless StateSet

+fix ident
This commit is contained in:
Julien Valentin
2018-01-13 21:25:47 +01:00
parent 8894939577
commit 4c0a861f91
2 changed files with 57 additions and 8 deletions

View File

@@ -70,10 +70,10 @@ class OSG_EXPORT Sampler : public osg::StateAttribute
* filtering, use normal filtering (equivalent to a max anisotropy
* value of 1.0. Valid range is 1.0f upwards. The maximum value
* depends on the graphics system. */
void setMaxAnisotropy(float anis);
void setMaxAnisotropy(float anis);
/** Gets the maximum anisotropy value. */
inline float getMaxAnisotropy() const { return _maxAnisotropy; }
/** Gets the maximum anisotropy value. */
inline float getMaxAnisotropy() const { return _maxAnisotropy; }
void setMinLOD(float anis);
@@ -90,6 +90,9 @@ class OSG_EXPORT Sampler : public osg::StateAttribute
/** Gets the maximum anisotropy value. */
inline float getLODBias() const { return _lodbias; }
/** helper method to generate Sampler from Texture's sampling parameters (except shadow_texture_mode left to NONE) */
static void generateSamplerObjects(StateSet&);
virtual void apply(State& state) const;
virtual void compileGLObjects(State&) const;
@@ -107,12 +110,12 @@ class OSG_EXPORT Sampler : public osg::StateAttribute
Texture::ShadowTextureMode _shadow_texture_mode;
Vec4d _borderColor;
Texture::FilterMode _min_filter;
Texture::FilterMode _mag_filter;
Texture::FilterMode _min_filter;
Texture::FilterMode _mag_filter;
float _maxAnisotropy, _minlod, _maxlod, _lodbias;
mutable buffered_value<GLuint> _PCsampler;
mutable buffered_value<uint8_t> _PCdirtyflags;
mutable buffered_value<uint8_t> _PCdirtyflags;
};
}
#endif