Vinay Shah wrote:
Thanks for the suggestion Jason.
There are a few other questions that you might be able to help me with also.
But first, I should also mention that I am writing to an off screen pbuffer . I have attached an image to viewer's camera (viewer.getCamera()->attach(osg::camera::COLOR_BUFFER, imageBuffer). I then send a pointer to the image's data to another thread (the frame generation thread) which compresses it and adds it to a video stream. I'm using two image buffers so that when the frame generation thread is compressing the image we can write to the other buffer).
It looks like sometimes we are accessing the imageBuffer before it is filled as I'm passing a black frame to the camera frame generation thread.
When I call viewer.frame() is the rendering completed or is that kicking off
another thread which does the rendering?
I believe (someone correct me if I'm wrong), that all the client-side
drawing commands are done at this point, but there might still be work
being done on the GPU. The quick and dirty way to be sure is to put a
glFinish() call here, but that will probably slow you down too much.
If you look at the osgscreencapture example, you might get some ideas on
a better way to do it. I'm not sure it will tell you everything, but
it's a start.
Also, can you provide some information on the various threading models? If I use singlethreading, does the viewer spawn it's own thread or will it render in the existing thread (the one that makes the call to viewer.frame).
I'm not totally sure about that. You can look at
osgViewer/ViewerBase.cpp for details (the startThreading() method is
where it all happens), or maybe someone else who knows better than me
will jump in :-)
--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org