Hi,

I've been fiddling with some of this at the end of last year for fast GPU to CPU. You could insert your code into the draw callback. Have you tried it? How is the performance? I could not make anything faster than the default readimage. You could also look at osgscreencapture for examples.

jp

Guy wrote:
Hi all,

I was wondering why when there is an image attached to an FBO camera buffer, the data transfer is made by glReadImage from the READ_BUFFER and not by glMapBuffer after copying the READ_BUFFER to PBO?

The same question goes in the other direction for updating textures with glTexSubImage.

Wouldn't that be faster (using the DMA)? Is there a scenario which it wouldn't be better that I miss.

If it is the best way I don't mind trying to help doing so, but I guess I'd need help designing it.

My initial approach is:

1. Add PBO object to image. (could be null)

2. Change image readpixels function to the following:

    If( PBO )

    {

        Copy pixels from READ_BUFFER to PBO

        Get PBO address

        Memcopy(data, address)

    }

    Else

       OldImageReadPixels

3. When attaching image to camera buffer automatically allocate PBO to that image.

That way there will be no change in render stage or any other part of OSG.

For textures there can be something similar. The Texture has PBO object, the function apply will check for the PBO if exists then copy data to the PBO address, then bind it and use glTexSumImage and in similar way change the copyTex to copy to the PBO and then from it's mapped address to a CPU address.

In textures maybe part of it could be implemented in subload callback.

Is it the correct path?

Does it already exists and I missed it? If so I'm sorry for the noise… :)

Thanks,

 Guy.


------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-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-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to