Hello All!
We have a current process that ‘renders to texture’ numerous 16MB images. We use a FrameBuffer to render the images off screen and then use glReadPixels to copy the newly created textures back into user space for post-processing analysis. Since the output textures are large and are ultimate processing rate is targeted for 2Hz, we are experiencing significant delays copying the textures from GPU to CPU memory.
We would like to implement the shared memory extensions available in v4.4 specifically the BufferObject and BufferTexture implementations. In all of our experiments using BufferTexture it seems that it is incompatible with the FBO as the BufferTexture really has no dimension (it is just a n-length byte array). All of our textures in the FBO are declared as GL_TEXTURE_2D. Output from our experiments is listed below with the FBO structure listed as the original implementation (that works but slow) and the attempt to use the BufferTexture approach but first a few questions…
[ul]
[li]Can we use the BufferTexture approach within a FrameBuffer Object?
[/li][li]If so, does anyone have an example?
[/li][li]If not, what would be an alternative approach?
[/li][li]Is it true that the BufferTexture is targeted for access within the shaders?
[/li][/ul]
Here is a diagnostic output from out program.
Original 2D texture
===== FBO STATUS =====
Max Number of Color Buffer Attachment Points: 8
Color Attachment 0: GL_TEXTURE, 4000x4000, GL_RED
Color Attachment 1: GL_TEXTURE, 4000x4000, GL_RED
Color Attachment 2: GL_TEXTURE, 4000x4000, GL_RED
Depth Attachment: GL_RENDERBUFFER, 4000x4000, GL_DEPTH_COMPONENT
Framebuffer complete.
With BufferTexture
===== FBO STATUS =====
Max Number of Color Buffer Attachment Points: 8
Color Attachment 0: GL_TEXTURE, 0x0, GL_RGBA
Color Attachment 1: GL_TEXTURE, 4000x4000, GL_RED
Color Attachment 2: GL_TEXTURE, 4000x4000, GL_RED
Depth Attachment: GL_RENDERBUFFER, 4000x4000, GL_DEPTH_COMPONENT
[ERROR] Framebuffer incomplete: Unknown error.