[osg-users] Help with callbacks and cameras
Hi folks, I have a camera responsible for updating some texture by rendering to it. What is the preferred way/callback to let the camera run only every 10th frame or so. I know I can use the the nodevisitor to get the framenumber, but I'm puzzled which callback to use to skip the camera all together for a frame. By skipping I also mean that the attached texture/FBO is not cleared and so on. Can this be done with the event callback (like skipping the frame event?) cheers Sebastian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help with callbacks and cameras
Hi Sebastian, I struggled with the same problem. The way how I resolved this was by keeping reference to the camera and working with the NodeMask (the camera was turned on at each N-th frame, otherwise was off). And the framebuffer was kept this way Hope this helps Nick On Tue, Dec 3, 2013 at 1:57 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi folks, I have a camera responsible for updating some texture by rendering to it. What is the preferred way/callback to let the camera run only every 10th frame or so. I know I can use the the nodevisitor to get the framenumber, but I'm puzzled which callback to use to skip the camera all together for a frame. By skipping I also mean that the attached texture/FBO is not cleared and so on. Can this be done with the event callback (like skipping the frame event?) cheers Sebastian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help with callbacks and cameras
Hi Sebastian, You could use an osg::Sequence node above the RTT osg::Camera that makes sure it's only traversed are certainly times, or use a custom cull callack attached to an osg::Group that decorates your RTT osg::Camera and decides whether to traverse or not to the interval you want. Robert. On 3 December 2013 10:57, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi folks, I have a camera responsible for updating some texture by rendering to it. What is the preferred way/callback to let the camera run only every 10th frame or so. I know I can use the the nodevisitor to get the framenumber, but I'm puzzled which callback to use to skip the camera all together for a frame. By skipping I also mean that the attached texture/FBO is not cleared and so on. Can this be done with the event callback (like skipping the frame event?) cheers Sebastian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org