[osg-users] compositeview and offscreen rendering

Peiman Shakeri peimansh2014 at gmail.com
Fri Jan 29 23:09:51 PST 2016

robertosfield wrote:
> Hi Peinman,
> Looking at your code the performance problems have little to do with
> OpenGL and the OSG and everything to with creating a new callback on
> every frame and writing to disk from the main thread,  File IO is very
> expensive so absolutely not something you want to do in main rendering
> thread.   The start/stop of threading and releaseContext() is rather
> odd too, I can't think what you are trying to achieve here.
> What you should do is create a single callback that you can toggle
> on/off when needed and have it generate an image write operation that
> it dispatches to a back ground thread that does the writing to disk.
> Ideally you'd recycle the images once you've finished.
> If this all sounds a bit involved, well what you are trying to do is
> reasonable advanced stuff, you are rather diving into the deep end
> without armbands having not learnt to swim yet...
> Robert.

hi Robert
thx for replying

1.without any writing to disk, frame rate is still down.my WindowCaptureCallback write nothing into disk.
2.The start/stop of threading and releaseContext() is necessary for multi threading model because of off-screen rendering on topview.
3.please more explain about that single callback and the way on/off it.

cheers peiman

Read this topic online here:

More information about the osg-users mailing list