Changeset 362 for experimental/distortionNG/extViewer.cpp
- Timestamp:
- Apr 22, 2012, 9:05:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/extViewer.cpp
r361 r362 21 21 #include <osg/Switch> 22 22 #include <osg/PolygonOffset> 23 #include <osg/PolygonMode> 23 24 #include <osg/Texture2D> 24 25 #include <osg/TextureRectangle> … … 269 270 osg::Geode* meshGeode = new osg::Geode(); 270 271 root->addChild(meshGeode, true); // Child #0 (adds mesh,shader,.. so camera renders mesh (and thus render the scene)) 271 272 272 273 273 // new we need to add the scene texture to the mesh, we do so by creating a 274 // StateSet to contain the Texture StateAttribute.274 // Modify StateSet to contain the Texture StateAttribute. 275 275 osg::StateSet* stateset = meshGeode->getOrCreateStateSet(); 276 276 stateset->setTextureAttributeAndModes(_distortionSet->getTexUnitScene(), sceneTexture,osg::StateAttribute::ON); 277 277 stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF); 278 // Modify StateSet to protectit agaiunst state changes by the stateset Manipulator 279 osg::PolygonMode* polyModeObj = new osg::PolygonMode; 280 stateset->setAttribute(polyModeObj, osg::StateAttribute::PROTECTED|osg::StateAttribute::ON); 278 281 279 282 osg::TexMat* texmat = new osg::TexMat;
Note: See TracChangeset
for help on using the changeset viewer.