资料来源:https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
Z-buffering
场景物体前后遮挡的关系
Z-Buffer Algorithm
1
2
3
4
5
6
7
8
Initialize depth buffer to ∞ During rasterization:
for (each triangle T)
for (each sample (x,y,z) in T)
if (z < zbuffer[x,y])
framebuffer[x,y] = rgb;
zbuffer[x,y] = z;
else
// do nothing, this sample