[osg-users] using image data on CPU side, from GLSL imageStore().

Daniel Lazaroff lazaroff_daniel at yahoo.ca
Thu Jul 7 08:16:47 PDT 2016


I am attempting to retrieve data from an image being written to in a geometry shader. The image contains unsigned ints that are the result of calculations done in the geometry shader (stored using the GLSL imageAtomicMin()). 

I setup an osg::Image and a osg::Texture1D in a similar way as in the osgcomputeshaders example, my "source" node contains a single osg::Geometry (the calculations in the geom shader use its vertex attributes). But instead of using a quad as recipient for drawing the results, I need to further operate on this image data. 

I can't figure out how to correctly/safely read back the contents of this image on the CPU side. Does Image::readImageFromCurrentTexture(..) need to be called somehow since it contains the glGetTexImage() ?

Thanks for any suggestions.


Read this topic online here:

More information about the osg-users mailing list