PDA

View Full Version : Wraparound Shift of Texture Data



Brad Howes
05-22-2007, 11:13 AM
I've got another radar application that presents its data more like a strip chart, with past strips available for comparison.

http://farm1.static.flickr.com/220/509589381_30cbb6da71.jpg?v=0

The rectangle on the left in the display is the live image. When the azimuth sweep bar (the white line), reaches the botton, the application saves a copy of the framebuffer and shows the saved images to the right. I'm using FBOs to capture the live data, and then using the FBO textures to perform the rendering in the live window. This all works great.

The user can mouse down in the left pane and scroll the azimuth values to change the azimuth bounds. The image below shows the display after such a change, with zero degrees now closer to the bottom of the screen:

http://farm1.static.flickr.com/230/509589383_cb924c4bef.jpg?v=0

Right now I'm clearing out the FBOs whenever their azimuth ranges change, though I can easily shift around the captured images, as shown above. I tried various approaches to rerender the FBO texture data, but with no luck, most likely due to the fact that tthe texture is in use by the FBO. Any ideas on how to best preserve the existing information in the FBO texture?

I've thought of two approaches: (1) create a new texture, bind that to the FBO, and then perform a render using the old texture into the new one; (2) create a new texture, and use glTexSubImage2D to copy the FBO pixel over to the new texture, then setup the FBO to use the new texture as the render target. Any thoughts on these approaches? Is there a more direct way to move pixels from one texture to another?

Thanks!

Brad