Zach Wienersmith nails it again! Too bad he's not on Mastodon. =(
Here's an example of depth buffering from a more complicated application that uses Kludge: molecule rendering.
This is an N-terminal Alanine molecule rendered in a space-filling style.
Those spheres are actually not meshes. They're rendered directly in the fragment shader, so they're pixel-perfect at any resolution. The fragment shader generates the depth information too.
Here's some fully-working sample code if you want to see how to use depth buffers in Kludge:
Even though the blue triangle is drawn after the red one, it has a farther z value, so it gets clipped by depth buffer testing.
Entrepreneur, Developer, Scientist
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!