View Full Version : How to compositing images with depth ?

06-20-2003, 05:50 AM
I am a beginner in OpenGl. I am programming a parallel rendering system.
I want to know how to composting images with depth in an efficient way using OpenGL. thanks a lot .

06-20-2003, 06:24 AM
do you mean: i have 2 color buffers and 2 depth buffers and i want to mix them using opengl ?
if so, create 2 RGBA textures with the color buffers, set the alpha component with the depth.
in ortho mode, draw a quad that fit the screen with the first texture. then activate alpha test (parameter: GL_LESS)and draw a second quad with the second texture.

take care of texture filtering which could create artefacts.

06-22-2003, 06:37 PM
Thank you yoyo, Let me try.