From b5474780c3127090a3da657aea3b3527aa81f0f1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 16 Sep 2008 09:31:29 +0000 Subject: [PATCH] Change the GLSL textureRec and texture2D parameters to use .st to make sure they only use 2D coords. Add setResizeNonPowerOfTwoHint to false for Texture2D. --- examples/osgmovie/osgmovie.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index 62364679b..e0f7001e3 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -303,6 +303,7 @@ osg::Geometry* myCreateTexturedQuadGeometry(const osg::Vec3& pos,float width,flo 0.0f, flip ? 1.0f : 0.0f , 1.0f, flip ? 0.0f : 1.0f); osg::Texture2D* texture = new osg::Texture2D(image); + texture->setResizeNonPowerOfTwoHint(false); texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR); texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE); texture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE); @@ -383,7 +384,7 @@ int main(int argc, char** argv) "uniform samplerRect movie_texture;\n" "void main(void)\n" "{\n" - " vec4 texture_color = textureRect(movie_texture, gl_TexCoord[0]); \n" + " vec4 texture_color = textureRect(movie_texture, gl_TexCoord[0].st); \n" " if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n" " gl_FragColor = texture_color;\n" "}\n" @@ -394,7 +395,7 @@ int main(int argc, char** argv) "uniform sampler2D movie_texture;\n" "void main(void)\n" "{\n" - " vec4 texture_color = texture2D(movie_texture, gl_TexCoord[0]); \n" + " vec4 texture_color = texture2D(movie_texture, gl_TexCoord[0].st); \n" " if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n" " gl_FragColor = texture_color;\n" "}\n"