3 ms·
How does opengl know which triangles are in front and which are behind?
by kazagistar 12y ago
How does opengl know which triangles are in front and which are behind?
- shultays 12y agohttp://en.wikipedia.org/wiki/Z-buffering http://en.wikipedia.org/wiki/Z-buffering It is called depth testing. There is a depth buffer (or z buffer) which contains the depth value for each pixel. When a pixel is to be written, its depth is calculated and compared the value in depth buffer, if it is closer to camera then it is drawn and value of depth buffer is changed, else the pixel is ignored.
- jheriko 12y agoit may not know. it depends on the context... but basically you have to tell it somehow.