Next, I draw my scene normally. My expectations are that OpenGL will update the depth and color buffers, while at the same time incrementing the value in the stencil buffer whenever the color buffer is drawn to.
Next, I set up the stencil buffer so that drawing will only take place where the stencil buffer is 1:
Thanks for the tip. Your information led to a fix in a rather indirect way. It turns out my problem was that I didn’t disable the clipping plane before drawing the viewport-filling polygon and it was being clipped.
I came to this conclusion when I saw the radeonvolumetexture sample call glDisable(GL_CLIP_PLANE0) prior to drawing its capping polygon.
I also found an error in the logic with my buffer usage.
Anyway, thanks a lot for the information. This problem was driving me to an early grave!