Hi,
Hui wrote: > > I try add a switch as _group and add processor inside. then > _gropu->setAllChildrenOff(); but then the rendering screen become black. But > it I call _group->setAllChildOn(); then rendering screen back to normal. > I tried it also here, and everything works fine. I can switch on/off ppu. > > Since the osgppu hijack the main camera and set a frame buffer object... > No, it does not! Only in the examples provided with osgPPU you have this behaviour. There I set a texture to be rendered to by main camera. So, in examples this is done to get input from camera (rendered scene) into a texture and then being processed. I would propose you to have two cameras in your scene graph. The one uses FBOs and processor is a child of this camera (don't forget to set camera also in the processor). The other camera don't use any render to texture and renders directly to the screen. Your scene has, of course, to be a child of both cameras. With a switch node you can switch between both cameras. When first one is on, you get processing by osgPPU. When second one is on, you get your scene rendered unprocessed. > > By the way, is it possible to set up osgPPU dynamically, instead at > beginning? > What do you mean dynamically? Just adding it later while running to the scene graph? I don't see anything which prevents you of doing this. Maybe a small example application would be helpfull to see what is going wrong. regards, art ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18578#18578 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

