Changeset 4322 for OpenSceneGraph/trunk/examples/osgmovie/osgmovie.cpp
- Timestamp:
- 06/09/05 10:29:22 (8 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgmovie/osgmovie.cpp
r4321 r4322 260 260 //useTextureRectangle = false; 261 261 262 static const char *shaderSource = {262 static const char *shaderSourceTextureRec = { 263 263 "uniform vec4 cutoff_color;\n" 264 264 "uniform samplerRect movie_texture;" … … 270 270 "}\n" 271 271 }; 272 273 static const char *shaderSourceTexture2D = { 274 "uniform vec4 cutoff_color;\n" 275 "uniform sampler2D movie_texture;" 276 "void main(void)\n" 277 "{\n" 278 " vec4 texture_color = texture2D(movie_texture, gl_TexCoord[0]); \n" 279 " if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n" 280 " gl_FragColor = texture_color;\n" 281 "}\n" 282 }; 283 272 284 osg::Program* program = new osg::Program; 273 program->addShader(new osg::Shader(osg::Shader::FRAGMENT,shaderSource)); 285 286 program->addShader(new osg::Shader(osg::Shader::FRAGMENT, 287 useTextureRectangle ? shaderSourceTextureRec : shaderSourceTexture2D)); 274 288 275 289 stateset->addUniform(new osg::Uniform("cutoff_color",osg::Vec4(0.1f,0.1f,0.1f,1.0f)));
