I’m trying to render my depth buffer to my color buffer for a compositing effect, (briefly described here,
http://www.opengl.org/registry/specs/NV/copy_depth_to_color.txt ), however, the edges are jagged.
So, I would like to use multisampling too, but when I turn it on, the result is not what I expected.
The edges are smooth, but I don’t want the extra garbage in the center.
I’m using glReadPixels to read my zbuffer, then using glDrawPixels to render it.
glEnable(GL_MULTISAMPLE_ARB);
RenderScene();
glDisable(GL_MULTISAMPLE_ARB);
glReadPixels( 0,0, w,h, GL_DEPTH_COMPONENT, GL_FLOAT, depth_buffer );
// in ortho mode
glDrawPixels( w,h, GL_DEPTH_COMPONENT, GL_FLOAT, depth_buffer );
Is this the proper way to get an (anti-aliased) composite outline of the rendered scene?
glDepthFunc() is always set to GL_LEQUAL, and GL_DEPTH_TEST is enabled.
Any suggestions?