[osg-users] Read frame buffer back into main memory

Robert Osfield robert.osfield at gmail.com
Fri Mar 2 08:46:33 PST 2018


Hi Antoine,

You can just do your glReadPixels(..) or osg::Image::readPixels(..) in
your own Camera::DrawCallback that you attach as a post draw callback
to your camera.

Robert.

On 2 March 2018 at 16:12, Antoine Rennuit <antoinerennuit at hotmail.com> wrote:
> Hi all,
>
> Hum, it seems my case is a bit more complex than expected. The camera I want to read the buffer from is a custom created camera:
>
>
> Code:
>     // Curvatures camera.
>     m_curvaturesCamera = new osg::Camera();
>     m_curvaturesCamera->setClearMask(GL_DEPTH_BUFFER_BIT); // The camera only clears the depth buffer before rendering (not the color buffer).
>     m_curvaturesCamera->setRenderOrder(osg::Camera::PRE_RENDER);
>     m_curvaturesCamera->setReferenceFrame(osg::Camera::RELATIVE_RF);
>
>
>
>
> I have had a look at osg::Image, but it does not seem very clear which function to use and above all, how I shall indicate  to the osg::image which camera it needs to read from.
>
> Any idea?
>
> Thank you!
>
> Cheers,
>
> Antoine.[/code]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=73002#73002
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list