Rendering behind another window

My problem is this: I have a scene I wish to draw in OpenGL. Parts of the scene take a long time to draw, so for performance reasons I don’t want to have to draw them more than once. My solution was to render the “slow” parts of the scene on the back buffer, copy the back buffer to the accumulation buffer, then draw the simple parts of the scene before flipping buffers. Then when I want to redraw, I can simply copy the accumulation buffer to the back buffer and re-render the simple parts of the scene.

This seems to work exactly as I want it to on Win2K. However, on the SGI O2 I’m also using, it only works right if no windows obscure the window I’m drawing to as I’m drawing. If there is another window sitting “on top of” my window while OpenGL is rendering, drawing (even to the back buffer) is clipped around that window. Thus, my copy of the scene on the accumulation buffer has a hole in it where the other window was. This is a problem when the other window is moved or my window comes to the top.

I’ve tried disabling GL_SCISSOR_TEST, but that didn’t help. Is there any way to turn this “feature” off? Is it specific to SGI, or is it an X thing?

The OpenGL specification states that any non-visible fragments, with respect to a window, are “undefined”. This means that for any that are off the screen, or that are under another window, their contents are undefined. Ultimately the effect of being obscured by a window is entirely up to the IHV’s. Under windows on nVidia (I’ve only tested this with older drivers but I wouldn’t expect it would differ) you’ll end up with the same issue you are observing on your SGI system.

I’m unfamiliar with SGI systems but under Windows I would force my Window to be always on top (or use pbuffers if that wasn’t desirable).

I was afraid you were going to say something like that. Thanks.

Originally posted by Margarine:
I was afraid you were going to say something like that. Thanks.

The alternative to rendering to the back buffer is to use a pbuffer, this won’t be affected by windows being overlayed ontop of one antoher. The questions then turns to wether pbuffers are supported on O2. With its UMA is surely should be a possibility, but it all comes down to drivers…

Robert.