Everybody loves 3d programming till they have to sort the world traingles based the MVP matrix.

Image of character from Team Fortress 2 saying "I fear no man" labelled Opengl Programmers "But that thing..." Tranparency "It scares me."

210 points · 7 comments · view on lemmy.world

7 Comments

deegeese@sopuli.xyz · 32 pts · 2y (4 replies)

You can use an O(n) radix sort on the Z-values because IEEE-754 floats share the integer property that leftmost bits always have higher values than rightward ones.

technohacker@programming.dev · 23 pts · 2y

Oh that just made it click in my head why they would do it as sign, exponent, mantissa and not sign, mantissa, exponent. I mean yes I've been taught it's for sorting purposes, but this really helped it fit better. Thanks!

257m@lemmy.ml · 9 pts · 2y

Thanks man, I'll look into it when I have the time. This should work on all IEEE compliant systems right?

GlitchSir@lemmy.world · 1 pts · 2y

His do I save a comment?

themusicman@lemmy.world · 1 pts · 2y

Holy shit

vzq@lemmy.blahaj.zone · 14 pts · 2y

I made a pact with myself in 2005 or so that I would never sort triangles by hand ever again. Since then I have been using higher level APIs and I have not regretted it.

frobeniusnorm@lemmy.world · 6 pts · 2y

All my homies use dual depth peeling