Get the latest tech news
Mipmap selection in too much detail
In this post, I want to shed some light on something I’ve been wondering about for a while: How exactly are mipmap levels selected when sampling textures on the GPU? If you already know what mipmapping is, why we use it, and what pixel derivatives (ddx() / ddy()) are, you can skip to the section Derivatives to mipmap levels. The post does, however, assume some knowledge of graphics programming.
Passing these explicitly can be useful in cases where the sampling locations are warped in a way that prevents ddx() and ddy() from returning useful partial derivatives (for example, during textured raymarching or parallax mapping). The first resource I managed to find, which made mention of an ellipse in the context of mipmap level selection, was the DirectX 11.3 Functional Spec(praise be), in Section 7.18.11 “LOD Calculations”. Returning to the DirectX 11 spec, recall that the paragraph about the elliptical transform read: “[…] it is important to calculate LOD using a proper orthogonal Jacobian matrix, as described by [Heckbert 89].
Or read this on Hacker News