Adam Heppenstall wrote:
Hi,

Currently the rendering is handled by a thread which calls

while(!viewer.done)
{
viewer.frame);
}

but in the software there can be up to 3 viewers active at one time, all running a seperate thread to render, this is a CPU hog and ideally i want to only update the viewer if the scene has changed.
Does anybody know of any ways of detecting changes in the scene graph?

or a better way of handling the rendering?

How much of a hog is it? If you have vsync enabled, it shouldn't be drawing more than 60 times a second or so. If you don't have it enabled, try enabling it and see if that helps.

If you really only want to render when the scene changes, there were some threads on the list a while a go about doing on-demand rendering. You might try a search of the archives for those. Just be aware that OSG wasn't designed for this usage, so you may run into a few issues that not a lot of people have experience with.

As far as detecting changes, that's up to your application. I don't think OSG can automagically do that for you.

--"J"

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to