Show
Ignore:
Timestamp:
07/19/05 18:30:55 (9 years ago)
Author:
robert
Message:

Ported all the render to texture examples across to using the new osg::CameraNode?.
Added support for texture cube maps in FBO + CameraNode?.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgdistortion/osgdistortion.cpp

    r4377 r4395  
    2626using namespace osg; 
    2727 
    28 osg::Node* createDistortionSubgraph(osg::Node* subgraph) 
     28osg::Node* createDistortionSubgraph(osg::Node* subgraph, const osg::Vec4& clearColour) 
    2929{ 
    3030    osg::Group* distortionNode = new osg::Group; 
     
    4343        osg::CameraNode* camera = new osg::CameraNode; 
    4444 
     45        // set clear the color and depth buffer 
     46        camera->setClearColor(clearColour); 
     47        camera->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 
     48 
    4549        // just inherit the main cameras view 
    4650        camera->setReferenceFrame(osg::Transform::RELATIVE_RF); 
     
    5054        // set viewport 
    5155        camera->setViewport(0,0,tex_width,tex_height); 
    52         camera->getOrCreateStateSet()->setAttribute(camera->getViewport()); 
    5356 
    5457        // set the camera to render before the main camera. 
     
    220223    } 
    221224     
    222     osg::Node* distortionNode = createDistortionSubgraph(loadedModel); 
     225    osg::Node* distortionNode = createDistortionSubgraph(loadedModel, viewer.getClearColor()); 
    223226     
    224227    // add model to the viewer.