- Timestamp:
- 07/19/05 18:30:55 (8 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgdistortion/osgdistortion.cpp
r4377 r4395 26 26 using namespace osg; 27 27 28 osg::Node* createDistortionSubgraph(osg::Node* subgraph )28 osg::Node* createDistortionSubgraph(osg::Node* subgraph, const osg::Vec4& clearColour) 29 29 { 30 30 osg::Group* distortionNode = new osg::Group; … … 43 43 osg::CameraNode* camera = new osg::CameraNode; 44 44 45 // set clear the color and depth buffer 46 camera->setClearColor(clearColour); 47 camera->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 48 45 49 // just inherit the main cameras view 46 50 camera->setReferenceFrame(osg::Transform::RELATIVE_RF); … … 50 54 // set viewport 51 55 camera->setViewport(0,0,tex_width,tex_height); 52 camera->getOrCreateStateSet()->setAttribute(camera->getViewport());53 56 54 57 // set the camera to render before the main camera. … … 220 223 } 221 224 222 osg::Node* distortionNode = createDistortionSubgraph(loadedModel );225 osg::Node* distortionNode = createDistortionSubgraph(loadedModel, viewer.getClearColor()); 223 226 224 227 // add model to the viewer.
