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

Reply via email to