Loading the code workspace…
Write a C program that implements a z-buffer for two overlapping triangles.
Requirements:
Z-buffering, invented independently by Wolfgang Straßer and Edwin Catmull in 1974, is the visibility algorithm every real-time renderer from the original Quake to Unreal Engine 5 relies on because it needs no triangle sorting and parallelizes trivially across pixels. Z-fighting artifacts from insufficient depth precision are a bug every graphics programmer eventually debugs, from indie Unity games to AAA titles.