Hi Christian,

You can use osg::PixelBufferObject to assist with transferring data to
and from the GPU.  However, to hide the cost of the wait for rendering
pipeline to flush and the transfer back it's best to double buffer and
read the previous frames result.  Without doing the double buffer
there is little benefit over just doing a standard glReadPixels.  The
OpenSceneGraph/osgscreencapture example illustrates the use of PBO's
including buffering.

However, it sounds like you want to result during the same frame so
the double buffering trick won't be applicable and you'll be stuck
with a hit for waiting for the GPU's rendering pipeline to complete
and then do the transfer, this round trip is very expensive and PBO's
can only smooth the edges a little, they can't make it cheap.  By far
the best way is to keep all the data on the GPU and do the processing
you require on the GPU using shaders/compute shaders/OpenCL/CUDA, only
passing the minimum amount of data if any back to the GPU.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to