Ignore:
Timestamp:
Apr 22, 2012, 9:05:32 PM (12 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/extViewer.cpp

    r361 r362  
    2121#include <osg/Switch>
    2222#include <osg/PolygonOffset>
     23#include <osg/PolygonMode>
    2324#include <osg/Texture2D>
    2425#include <osg/TextureRectangle>
     
    269270                osg::Geode* meshGeode = new osg::Geode();
    270271                root->addChild(meshGeode, true);        // Child #0  (adds mesh,shader,.. so camera renders mesh (and  thus render the scene))
    271                
    272272
    273273                // 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.
    275275            osg::StateSet* stateset = meshGeode->getOrCreateStateSet();
    276276        stateset->setTextureAttributeAndModes(_distortionSet->getTexUnitScene(), sceneTexture,osg::StateAttribute::ON);
    277277        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);
    278281
    279282                osg::TexMat* texmat = new osg::TexMat;
Note: See TracChangeset for help on using the changeset viewer.