Show
Ignore:
Timestamp:
09/16/08 11:31:29 (6 years ago)
Author:
robert
Message:

Change the GLSL textureRec and texture2D parameters to use .st to make sure they only use 2D coords.

Add setResizeNonPowerOfTwoHint to false for Texture2D.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgmovie/osgmovie.cpp

    r8757 r8857  
    304304                                     
    305305        osg::Texture2D* texture = new osg::Texture2D(image); 
     306        texture->setResizeNonPowerOfTwoHint(false); 
    306307        texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR); 
    307308        texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE); 
     
    384385            "void main(void)\n" 
    385386            "{\n" 
    386             "    vec4 texture_color = textureRect(movie_texture, gl_TexCoord[0]); \n" 
     387            "    vec4 texture_color = textureRect(movie_texture, gl_TexCoord[0].st); \n" 
    387388            "    if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n" 
    388389            "    gl_FragColor = texture_color;\n" 
     
    395396            "void main(void)\n" 
    396397            "{\n" 
    397             "    vec4 texture_color = texture2D(movie_texture, gl_TexCoord[0]); \n" 
     398            "    vec4 texture_color = texture2D(movie_texture, gl_TexCoord[0].st); \n" 
    398399            "    if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n" 
    399400            "    gl_FragColor = texture_color;\n"