From Mathias Froehlich, Changed osg::TextureRectangle to use osg::Texutre::applyTexParameters() to take advantage of texture shadow extension settings for texture rectangle
This commit is contained in:
parent
b496d220c6
commit
7b16ff5ae1
@ -129,8 +129,6 @@ class OSG_EXPORT TextureRectangle : public Texture
|
||||
virtual void computeInternalFormat() const;
|
||||
void allocateMipmap(State& state) const;
|
||||
|
||||
void applyTexParameters(GLenum target, State& state) const;
|
||||
|
||||
void applyTexImage_load(GLenum target, Image* image, State& state, GLsizei& inwidth, GLsizei& inheight) const;
|
||||
void applyTexImage_subload(GLenum target, Image* image, State& state, GLsizei& inwidth, GLsizei& inheight, GLint& inInternalFormat) const;
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <osg/Timer>
|
||||
#include <osg/ApplicationUsage>
|
||||
#include <osg/FrameBufferObject>
|
||||
#include <osg/TextureRectangle>
|
||||
|
||||
#include <OpenThreads/ScopedLock>
|
||||
#include <OpenThreads/Mutex>
|
||||
@ -830,7 +831,7 @@ void Texture::applyTexParameters(GLenum target, State& state) const
|
||||
}
|
||||
|
||||
// integer texture are not supported by the shadow
|
||||
if (extensions->isShadowSupported() && target == GL_TEXTURE_2D &&
|
||||
if (extensions->isShadowSupported() && (target == GL_TEXTURE_2D || target == GL_TEXTURE_RECTANGLE) &&
|
||||
_internalFormatType != SIGNED_INTEGER && _internalFormatType != UNSIGNED_INTEGER)
|
||||
{
|
||||
if (_use_shadow_comparison)
|
||||
|
@ -260,21 +260,6 @@ void TextureRectangle::apply(State& state) const
|
||||
}
|
||||
}
|
||||
|
||||
void TextureRectangle::applyTexParameters(GLenum target, State& state) const
|
||||
{
|
||||
// get the contextID (user defined ID of 0 upwards) for the
|
||||
// current OpenGL context.
|
||||
const unsigned int contextID = state.getContextID();
|
||||
|
||||
glTexParameteri( target, GL_TEXTURE_WRAP_S, _wrap_s );
|
||||
glTexParameteri( target, GL_TEXTURE_WRAP_T, _wrap_t );
|
||||
|
||||
glTexParameteri( target, GL_TEXTURE_MIN_FILTER, _min_filter);
|
||||
glTexParameteri( target, GL_TEXTURE_MAG_FILTER, _mag_filter);
|
||||
|
||||
getTextureParameterDirty(contextID) = false;
|
||||
}
|
||||
|
||||
void TextureRectangle::applyTexImage_load(GLenum target, Image* image, State& state, GLsizei& inwidth, GLsizei& inheight) const
|
||||
{
|
||||
// if we don't have a valid image we can't create a texture!
|
||||
|
Loading…
Reference in New Issue
Block a user