Hi Robert,

Robert Osfield wrote:
Hi J.P,

The biggest problem with getting PBO read back to work efficiently is
getting the pixel formats of the buffer and the read back in a form
that is supported by the hardware+driver in a way that avoids any
local copy and pixel format changes.

Yes, I've been through quite a number of combinations in the past week :) Also, depending on hardware/drivers the read back PBO might not even be on the GPU. Even memory alignment of user buffers seems to make a difference in some cases. CUDA has some calls for allocating host memory which can then be used to efficiently transfer data (because the driver now knows about the specifics). This might end up to be the fastest path back to the CPU in the end. I'll start abusing osgPPU...


Binding FBO's etc. isn't that hard, just a single call, so I don't see
much of an issue with duplication.  Writing callbacks is an advanced
topic too, the OSG can try and hide alot of the complexity but in the
end if you want to do something very specific then you'll need to roll
your sleeves up and implement it, and accept that you'll need to
understand both the OpenGL and OSG functions/classes constraints.

I'm OK with this.

thanks
jp


Robert.

On Tue, Dec 8, 2009 at 3:07 PM, J.P. Delport <[email protected]> wrote:
Hi,

Robert Osfield wrote:
Hi J.P.,

On Tue, Dec 8, 2009 at 2:34 PM, J.P. Delport <[email protected]> wrote:
yes, but they are reading from either the frame buffer or a pbuffer, not
from an FBO RTT camera.
An FBO should not present any particular problems.
Firstly, I'm not advocating code changes. The current read back from FBO if
I attach images to a camera works fine. I have not been able to make
anything faster, even by hacking my PBO readpixel code into RenderStage :)

In the FBO case: the FBO can have multiple attachments, so if I want to use
glReadPixels in the camera callback I have to iterate through the camera's
attachments, bind the FBO manually (RenderStage already did unbind), bind
the PBO, set the read buffer to the appropriate attachment etc. Iow I
duplicate the code in RenderStage in the callback. It's not that it's
impossible.

jp

Robert.
_______________________________________________
osg-submissions mailing list
[email protected]

http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail
legal notice, and implemented Open Document Format (ODF) standard. The full
disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.  MailScanner thanks Transtec
Computers for their support.

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

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

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

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

Reply via email to