when reading on openGL I found something that I could not comprehend. It's regarding this link method description. I have been trying to implement what they are saying but I fail to grasp some elements. Suppose we have 3 images i=0..2 image[i][width*height*4] (considering a rgba8 image) and the corresponding depths of each image float depth[i][width*height]. How would I go about in implementing the technique described in the link?. I'm also interested if instead of image if I have a compressed texture could I still use the technique described there? EDIT: I've tried to put the explanation into code but I've only managed to come up with this so far because I could not understand the procedure
glDrawPixels(width,height,GL_DEPTH_COMPONENT,GL_FLOAT,depth[0]);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_FALSE);
glEnable(GL_STENCIL_TEST);
glStencilFunc(GL_EQUAL,0x1,0x1);
glStencilOp(GL_KEEP,GL_KEEP,GL_REPLACE);
glDrawPixels(width,heigh,GL_RGBA,GL_UNSIGNED_BYTE,image[0]);
//don't know what comes next