confused with zbuffer
hello, helper,
I use the following code to get the depth component of the pixels on the screen:
glReadPixels(0, 0, viewport[2], viewport[3],
GL_DEPTH_COMPONENT, GL_FLOAT, zbuffer);
viewport[2] is the width of the window;
viewport[3] is the height of the window;
If I want to get the depth value of a pixel with coord (x,y) from the zbuffer, shall I use zbuffer[ x + y * viewport[2] ] or
zbuffer[ x * viewport[3] + y ]?
Thanks!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement