PDA

View Full Version : How to compositing images with depth ?



edward
06-20-2003, 06: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 .

errno
06-20-2003, 07:24 AM
hi.
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.

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