Post #3026533
2026-06-01 01:34 UTC
when game programmers say they sort objects back to front, or front to back, before drawing them, e.g. to get correct alpha blending, or to not rely on a z-buffer for some reason ...
i wonder if they know that you can't actually do that, in general. even with convex objects. even with just three triangles. there is no way to sort them. because you can have A overlap B overlap C overlap A.
see this helpful illustration from the khronos opengl wiki:
https://wikis.khronos.org/opengl/Transparency_Sorting
Replies (1)
-
@joe@f.duriansoftware.com 2026-06-01 01:39
@typeswitch@gamedev.lgbt i dunno about the kids these days, but when i first learned to do transparent rendering 30 years ago the book was like “yeah you can’t actually do this, but sorting by center is probably good enough, and just design your assets around it”