- Timestamp:
- 06/18/08 16:21:22 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgprerender/osgprerender.cpp
r8217 r8448 201 201 202 202 203 osg::Node* createPreRenderSubGraph(osg::Node* subgraph, unsigned tex_width, unsigned tex_height, osg::Camera::RenderTargetImplementation renderImplementation, bool useImage, bool useTextureRectangle, bool useHDR) 203 osg::Node* createPreRenderSubGraph(osg::Node* subgraph, 204 unsigned tex_width, unsigned tex_height, 205 osg::Camera::RenderTargetImplementation renderImplementation, 206 bool useImage, bool useTextureRectangle, bool useHDR, 207 unsigned int samples, unsigned int colorSamples) 204 208 { 205 209 if (!subgraph) return 0; … … 360 364 361 365 // attach the image so its copied on each frame. 362 camera->attach(osg::Camera::COLOR_BUFFER, image); 366 camera->attach(osg::Camera::COLOR_BUFFER, image, 367 samples, colorSamples); 363 368 364 369 camera->setPostDrawCallback(new MyCameraPostDrawCallback(image)); … … 377 382 { 378 383 // attach the texture and use it as the color buffer. 379 camera->attach(osg::Camera::COLOR_BUFFER, texture); 384 camera->attach(osg::Camera::COLOR_BUFFER, texture, 385 0, 0, false, 386 samples, colorSamples); 380 387 } 381 388 … … 428 435 } 429 436 430 unsigned tex_width = 1024; 431 unsigned tex_height = 512; 437 unsigned int tex_width = 1024; 438 unsigned int tex_height = 512; 439 unsigned int samples = 0; 440 unsigned int colorSamples = 0; 441 432 442 while (arguments.read("--width", tex_width)) {} 433 443 while (arguments.read("--height", tex_height)) {} … … 440 450 while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; } 441 451 while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; } 452 while (arguments.read("--fbo-samples", samples)) {} 453 while (arguments.read("--color-samples", colorSamples)) {} 442 454 443 455 bool useImage = false; … … 470 482 471 483 osg::Group* rootNode = new osg::Group(); 472 rootNode->addChild(createPreRenderSubGraph(loadedModelTransform,tex_width,tex_height, renderImplementation, useImage, useTextureRectangle, useHDR ));484 rootNode->addChild(createPreRenderSubGraph(loadedModelTransform,tex_width,tex_height, renderImplementation, useImage, useTextureRectangle, useHDR, samples, colorSamples)); 473 485 474 486 // add model to the viewer.
