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

2018-03-07 Thread Robert Osfield
On 7 March 2018 at 13:34, Antoine Rennuit wrote: > Problem solved, thanks to you Robert, Sebastian and Lionel! Could you explain what the issue was and how you solved. This will help others who search for solution to problems like the one you've described. Thanks, Robert ___

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

2018-03-07 Thread Antoine Rennuit
Problem solved, thanks to you Robert, Sebastian and Lionel! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=73035#73035 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.opensc

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

2018-03-07 Thread Antoine Rennuit
Thanks Robert, This has helped pinpoint the problem! Antoine. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=73034#73034 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.op

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

2018-03-07 Thread Robert Osfield
Hi Antoine, On 6 March 2018 at 17:44, Antoine Rennuit wrote: > Error writing file /home/arennuit/testImage.bmp: Warning: Could not find > plugin to write image to file "/home/arennuit/testImage.bmp". > Error writing file /home/arennuit/testImage.jpg: Warning: Could not find > plugin to write im

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

2018-03-06 Thread Antoine Rennuit
Hello Robert, And thanks for you message. I am trying to write the image to a file using Code: class ReadPixelsCallback : public osg::Camera::DrawCallback { public: virtual void operator()( osg::RenderInfo& renderInfo ) const { osg::GraphicsContext* gc = renderInfo.getState()->g

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

2018-03-02 Thread Robert Osfield
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 wrote: > Hi all, > > Hum, it seems my case is a bit more complex than expect

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

2018-03-02 Thread Antoine Rennuit
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 cle

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

2018-03-01 Thread Sebastian Messerschmidt
Hi Antoine, set a postDrawCallback to the pass/camera that writes to the texture. In the callback: virtual void operator () (osg::RenderInfo& render_info) const { osg::State* state=render_info.getState(); state->apply(render_info.getCurrentCamera()->getStateSet()); state->apply

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

2018-03-01 Thread Antoine Rennuit
This looks promising... Thanks! Antoine. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=72992#72992 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listi

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

2018-02-28 Thread Lionel Lagarde
Hi, Have a look to glReadPixel. The osg::Image class has a method to read the frame buffer back to its own memory. On 28/02/2018 19:05, Antoine Rennuit wrote: Hi all, I need to read the frame buffer back into the main memory. I know this will kill performance but I only need to do it once.

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

2018-02-28 Thread Antoine Rennuit
Hi all, I need to read the frame buffer back into the main memory. I know this will kill performance but I only need to do it once. Is there a way to do that? I could not find clear answers on the internet. Thanks, Antoine. -- Read this topic online here: http://forum.openscen