Partial swapbuffers?

Hi,
I have a very complex scene drawn and I wish to update just a small part of it. If I redraw everything when I make the change it is going to be too slow. Is it possible to just draw the changes in the backbuffer and then swap just the small area which has the change? (I thought I might be able to do this by setting the scissor region around the changed area and swapping buffers, but I think swapbuffers swaps the entire buffer, ignoring the scissor test.)

Is it reasonable to draw my change to the backbuffer and then do a copypixels (or a read/drawpixels) from the back to the front for just the changed area?

You can either render to a texture and paste that onto the front buffer, or you can draw the complex scene to a texture and paste it over the framebuffer before rendering each frame. I would probably use the latter method.

I’m not sure a texture would work, as I’m talking about a potentially full-screen display. Do you mean an off-screen buffer?

Originally posted by Adrian67:
Is it reasonable to draw my change to the backbuffer and then do a copypixels (or a read/drawpixels) from the back to the front for just the changed area?

Some CAD programs do expensive dirty region updates via glCopyPixels or via GL_WIN_SWAP_HINT extension.

You may also find interesting WGL_buffer_region or KTX_buffer_region for saveunder management.

There is a great example of partial Swap Buffer described in “OpenGL SuperBible” if you do have the chance to borrow it do it. There’s a sample that uses partial swap buffer for an airplane console. It renders the terrain and copies first 60% of buffer to screen for terrain. The other 40% are updated only if someone changes attitude or something. It uses an common opengl extention which I currently do not know what it is.