Ported all the render to texture examples across to using the new osg::CameraNode.

Added support for texture cube maps in FBO + CameraNode.
This commit is contained in:
Robert Osfield
2005-07-19 16:30:55 +00:00
parent 5c9bd792a3
commit 8dd013171c
23 changed files with 786 additions and 709 deletions

View File

@@ -213,13 +213,11 @@ osg::Node* createPreRenderSubGraph(osg::Node* subgraph)
// set view
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera->setViewMatrixAsLookAt(bs.center()+osg::Vec3(0.0f,2.0f,0.0f)*bs.radius(),bs.center(),osg::Vec3(0.0f,0.0f,1.0f));
camera->setViewMatrixAsLookAt(bs.center()-osg::Vec3(0.0f,2.0f,0.0f)*bs.radius(),bs.center(),osg::Vec3(0.0f,0.0f,1.0f));
// set viewport
camera->setViewport(0,0,tex_width,tex_height);
camera->getOrCreateStateSet()->setAttribute(camera->getViewport());
// set the camera to render before the main camera.
camera->setRenderOrder(osg::CameraNode::PRE_RENDER);