I have a textured quad that I am using to display a float texture from a RTT camera setup. Actually, I am attaching 4 textures to the FBO and rendering "stuff" to each of the 4. I want to be able to hit a key and cycle through the textures being displayed. How do I do this? Would it be as simple as using a key handler to set a uniform setting the texture unit in the frag shader? Also, I found that if I enable more than 2 textures, as follows, I get a memory corrpution error... Do I need to explicitly enable multitexturing?

geom->getOrCreateStateSet()->setTextureAttributeAndModes(0, Texture0, osg::StateAttribute::ON); geom->getOrCreateStateSet()->setTextureAttributeAndModes(1, Texture1, osg::StateAttribute::ON); geom->getOrCreateStateSet()->setTextureAttributeAndModes(2, Texture2, osg::StateAttribute::ON); geom->getOrCreateStateSet()->setTextureAttributeAndModes(3, Texture3, osg::StateAttribute::ON);


CD


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to