Mipmap selection in too much detail
5 comments
·May 11, 2025pema99
PaulDavisThe1st
Totally fantastic article. I don't do work that overlaps with this at all, but even after 37+ years as a C++ programmer, I found this enlightening, engaging and informative. Thank you very much.
boulos
Great writeup!
I can't tell from your GLSL if these would have forced FMAs for a lot of the intermediate product sums. That would probably be a non-trivial effect, particularly for your large anisotropy cases.
The Heckbert paper also describes the basic theory, but you would want to supplement with some of the offline rendering work that followed it. OpenImageIO (OIIO) is pretty widely used, and has gone through several iterations of bug fixing like https://github.com/AcademySoftwareFoundation/OpenImageIO/pul...
But for your purposes, you probably just need to find all the magic epsilons and sign checks to make it match.
aeonik
"You couldn’t implement these functions yourself - they are magic intrinsics which are implemented in hardware"
But why?pema99
There simply isn't another way to access registers from one 'thread' on another thread without using an intrinsic. You need that to calculate finite differences. For a long time, the only option was ddx()/ddy(). Now we also wave intrinsics, which you couldn't implement yourself either.
Author here - I imagine this is a bit too niche to get much traction on HN. There's a bit of discussion on bsky https://bsky.app/profile/pema99.bsky.social/post/3lotdtgowf2...