Changeset 12531 for OpenSceneGraph/trunk/examples/osgmultiplerendertargets/osgmultiplerendertargets.cpp
- Timestamp:
- 06/15/11 11:35:25 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgmultiplerendertargets/osgmultiplerendertargets.cpp
r12292 r12531 195 195 // Here a scene consisting of a single quad is created. This scene is viewed by the screen camera. 196 196 // The quad is textured using a shader and the multiple textures generated in the RTT stage. 197 osg::Node* createScene(osg::Node* cam_subgraph, unsigned int tex_width, unsigned int tex_height, bool useHDR, bool useImage )197 osg::Node* createScene(osg::Node* cam_subgraph, unsigned int tex_width, unsigned int tex_height, bool useHDR, bool useImage, bool useMultiSample) 198 198 { 199 199 if (!cam_subgraph) return 0; … … 349 349 // attach the textures to use 350 350 for (int i=0; i<NUM_TEXTURES; i++) { 351 camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0+i), textureRect[i]); 351 if (useMultiSample) 352 camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0+i), textureRect[i], 0, 0, false, 4, 4); 353 else 354 camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0+i), textureRect[i]); 355 356 352 357 } 353 358 … … 417 422 while (arguments.read("--image")) { useImage = true; } 418 423 424 bool useMultiSample = false; 425 while (arguments.read("--ms")) { useMultiSample = true; } 426 419 427 osg::Group* subGraph = createRTTQuad(tex_width, tex_height, useHDR); 420 428 421 429 osg::Group* rootNode = new osg::Group(); 422 rootNode->addChild(createScene(subGraph, tex_width, tex_height, useHDR, useImage ));430 rootNode->addChild(createScene(subGraph, tex_width, tex_height, useHDR, useImage, useMultiSample)); 423 431 424 432 // add model to the viewer.
