frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Mipmap selection in too much detail

https://pema.dev/2025/05/09/mipmaps-too-much-detail/
99•luu•1y ago

Comments

pema99•1y ago
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...
boulos•1y ago
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.

pema99•1y ago
Cool resource, haven't seen this before
PaulDavisThe1st•1y ago
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.
Agentlien•1y ago
This was a wonderful article! I love this kind of exploration.
ImHereToVote•1y ago
This is very relevant to what I'm doing. I'm trying to reproduce the MIP pipeline to get anti-aliased procedural details in fragment. specifically converting high frequency details into roughness.
sebastianmestre•1y ago
A while back I read a paper about downsampling normal maps and converting lost detail into roughness

I can try to find it if you want

ImHereToVote•1y ago
Nvidia has a quite blocky MIP selection. Did an Nvidia engineer decide that consumers don't notice, and fixed functioned the hell out of it?
lloeki•1y ago
I for one liked the article! Great visualisations.

There's a bit of nostalgia ;) Brought me back to the days where GL display lists were the fancy thing to do and any kind of non-ff shader were but a wild dream.

AshleysBrain•1y ago
Perfect blog post for HN IMO - any blog title involving "in too much detail" will probably do well! Great job with the post, the visualizations are fantastic.
hmage•1y ago
I have a hunch nvidia's mipmapping algorithm changes if you open nvidia control panel and change texture filtering to "high performance" vs "high quality"
DDoSQc•1y ago
This is great! Would've been really useful a couple months ago when I was refactoring Lavapipe's texture filtering. I worked off the Vulkan spec, which doesn't mention the elliptical transformation. I did notice that the spec says:

> The minimum and maximum scale factors (ρmin, ρmax) should be the minor and major axes of this ellipse.

Where "should" probably means some transformation can be applied (would be "must" otherwise).

Now I'm tempted to implement your visualizations so I can compare my work to your hardware references, and spend more hours getting it closer to actual hardware.

TonyTrapp•1y ago
Great article! If you think it has too much detail, you probably selected the wrong mipmap level for it ;)
flexagoon•1y ago
Btw, in case you're not aware, the article is somewhat unreadable on mobile devices because the code blocks can't be scrolled horizontally, so half of the code just doesn't fit on the screen. Also, the long latex formula overflows the screen and causes the entire page to move horizontally.
sebastianmestre•1y ago
Fyi; you can scroll the code blocks if you zoom out until there is no more horizontal scroll on the page

Still sucky but at leas you can read the code

pema99•1y ago
I have close to zero experience with web development, I guess it shows
aeonik•1y ago

    "You couldn’t implement these functions yourself - they are magic intrinsics which are implemented in hardware"
But why?
pema99•1y ago
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.
Sharlin•1y ago
You need to access the neighboring pixels (fragments) in a quad to compute d_dx and d_dy, but quads are an implementation detail not exposed to the programmer.
lifelesson701•1y ago
Ap Kon he
kajkojednojajko•1y ago
Insane deep-dive! Framing texture sampling as "Ideally, we’d like to integrate over the projection of the screen pixel onto the texture" was enlightening for me. I particularly enjoyed the explanation of anisotropic filtering because it always seemed like magic to me, and in the context of aligning ellipses on textures it just makes sense :D
gitroom•1y ago
Pretty cool seeing someone dig this deep - I always wish I understood these graphics tricks better
llm_nerd•1y ago
This isn't my specialty, and ultimately it really doesn't matter to the core point of this good submission about how the GPU chooses mipmap level to use, however the article gives the impression that we pre-calculate mipmap levels to improve distant aliasing, though the problem they demonstrate is solved with trivial texture filtering.

Mipmaps are a performance optimization[1]. You could just use a 4096x4096 brick texture across your entire game, and then use texture filtering to make it look good both close and far, but that means that rendering a distant wall polygon that might fill just a few pixels of the viewport needs to filter and apply a 16.7 million texel texture, redoing the filtering again and again and evicting everything else from caches just for that one texture. If instead it can apply a 32x32 pre-filtered texture to loads of distant objects, there are obviously massive performance ramifications. Which is why mipmaps are used, letting massive textures be used for those cases where the detail is valuable, without destroying performance when it's just some distant object.

And of course modern engines do the same thing with geometry now, where ideally there is hierarchy of differing level of detail geometry and it will choose the massive-vertices object when it fills the scene, and the tiny, super optimized one when it's just a few pixels.

[1] As one additional note, all major graphics platforms can automatically generate mipmaps for textures...but only if the root is uncompressed. Modern texture compression is hugely compute bound and yields major VRAM savings so almost all games pre-compute the mipmapping and then do the onerous compression in advance.

pema99•1y ago
I agree that mipmapping is an optimization, but I also don't really consider it incorrect or misleading to call it a technique for mitigating aliasing - it's a practical technique for doing so. Fair point though, and perhaps I should have mentioned this.
ahartmetz•1y ago
I didn't even read what these circle images mean, but it's fun to see that AMD and Adreno look the same... because Adreno is AMD / ATI's old mobile architecture that was sold off a long time ago (and an anagram of Radeon).

JSON-LD Explained for Personal Websites

https://hawksley.dev/blog/json-ld-explained-for-personal-websites/
83•ethanhawksley•2h ago•19 comments

Prefer duplication over the wrong abstraction (2016)

https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction
355•rafaepta•4h ago•245 comments

Beyond All Reason (Free Total Annihilation Inspired RTS)

https://www.beyondallreason.info
376•mosiuerbarso•9h ago•216 comments

(How to Write a (Lisp) Interpreter (In Python)) (2010)

https://norvig.com/lispy.html
141•tosh•5h ago•41 comments

Identity verification on Claude

https://support.claude.com/en/articles/14328960-identity-verification-on-claude
370•bathory•8h ago•332 comments

The minimum viable unit of saleable software

https://brandur.org/minimum-viable-unit
74•brandur•4h ago•36 comments

Show HN: CleverCrow: give tokens to your favorite projects

https://clevercrow.io
17•zhubert•2h ago•17 comments

An Embedded Linux on a Single Floppy

https://github.com/w84death/floppinux
35•modinfo•2d ago•18 comments

Ask for no, don't ask for yes (2022)

https://www.mooreds.com/wordpress/archives/3518
6•skogstokig•49m ago•0 comments

Occupancy Math on the AMD MI355X: A From-First-Principles Guide

https://indianspeedster.github.io/blog/occupancy-math-mi355x/
33•skidrow•4d ago•2 comments

A 3D voxel game engine written in APL

https://github.com/namgyaaal/avoxelgame
133•sph•13h ago•11 comments

15-minute at-home Lyme disease tick test

https://www.bostonglobe.com/2026/06/17/business/lyme-disease-tick-test/
212•bookofjoe•3d ago•145 comments

Cocktail Optimization, an Integer Programming Problem

https://bunkum.us/2026/06/18/cocktail-ingredients-milp
14•ftgregg•2d ago•2 comments

Wildcard (YC W25) is hiring an applied ML engineer

https://www.ycombinator.com/companies/wildcard/jobs/SEmo4di-founding-applied-ml-engineer
1•kaushikmahorker•4h ago

Loupe – A iOS app that raises awareness about what native apps can see

https://github.com/mysk-research/loupe
493•Cider9986•1d ago•205 comments

Developers don't understand CORS (2019)

https://fosterelli.co/developers-dont-understand-cors
329•toilet•19h ago•248 comments

Show HN: TownSquare, a tiny presence layer for websites

https://townsquare.cauenapier.com/
231•cauenapier•1d ago•135 comments

Running MicroVMs in Proxmox VE, the Easy Way

https://taoofmac.com/space/blog/2026/06/18/1845
193•zdw•2d ago•33 comments

System call instrumentation on Linux/x86‑64 using memory‑indirect calls, part I

https://www.humprog.org/~stephen/blog/2026/06/15/#system-call-instrumentation-on-intel-negative-r...
34•matt_d•4d ago•14 comments

Proportional-Integral-Derivative (PID) controllers

https://en.wikipedia.org/wiki/PID_controller
77•dhorthy•2d ago•45 comments

Excessive nil pointer checks in Go

https://konradreiche.com/blog/excessive-nil-pointer-checks-in-go/
85•ingve•3d ago•63 comments

Slow breathing modulates brain function and risk behavior

https://www.cell.com/neuron/fulltext/S0896-6273(26)00339-9
355•croes•22h ago•101 comments

Djevops: Self-Host Django Easily

https://github.com/mherrmann/djevops
4•mherrmann•3d ago•0 comments

Burnout is real for open source maintainers

https://openjsf.org/blog/burnout-is-real-for-open-source-maintainers
101•theanonymousone•4h ago•49 comments

Show HN: Pulse – Dashboard for Claude Code, approve tool calls from your phone

https://github.com/nikitadoudikov/claude-pulse
22•nikitadvd•1d ago•10 comments

Renting a sewing machine from the library

https://www.bbc.com/future/article/20260618-the-weird-and-wonderful-libraries-of-finland
325•sohkamyung•22h ago•192 comments

The brain was not designed for this much bad news

https://www.sciencedaily.com/releases/2026/06/260614012006.htm
339•colinprince•17h ago•288 comments

Fossil Fuels Are 40% of Freight Shipping Tonnage, but Half Its Fuel Use

https://cleantechnica.com/2026/06/16/shipping-freight-energy-fossil-cargo/
122•choult•6h ago•89 comments

Epoll vs. io_uring in Linux

https://sibexi.co/posts/epoll-vs-io_uring/
247•Sibexico•22h ago•59 comments

Two Qwen3 models on one DGX Spark: the residency math

https://www.devashish.me/p/two-qwen3-models-on-one-dgx-spark
80•devashish86•3d ago•36 comments