1

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
Ray
  • 339
  • 3
  • 12
  • 1
    Even after reading the link, your question is still pretty vague. Can you give us more detail, and maybe an example of what you've got so far? – luke May 11 '12 at 16:35
  • Basically I'm asking how to do depth-sorting using the depth buffer and the stencil buffer if I have the images and the associated depth's stored in memory. After reading that link I thought that it tells you how to do it but I'm unable to completely understand it. – Ray May 13 '12 at 06:03

0 Answers0