Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there advantages of MipMaps aside from the performance ones?

Is the only true advantage of the mipmaps that the filtering required in real time will be less demanding, as it will have been done partly in advance?

Could you not achieve identical results with linear or anisotropic filtering and a little bit more processing power?

like image 603
Jules G.M. Avatar asked Dec 15 '22 10:12

Jules G.M.


1 Answers

Not with "a little bit" more processing power, but with several orders of magnitude more. As an extreme example, consider a quad with a texture mapped to it, but scaled down so the quad is rendered onto a single screen pixel. That screen pixel is then expected to have the average colour value over the entire texture.

When using mipmaps, there will be a 1x1 precomputed mipmap level that has the colour value you want. One simple lookup, fast and easy.

When not using mipmaps, to achieve the exact same effect, rendering this one pixel would mean doing a texture lookup for every single pixel in the texture and then averaging over them. We could take shortcuts by averaging over only, say, 16 equally spaced pixels, but that could make a marked difference in the output (consider what this would do to checkerboard patterns).

So whilst this theoretically could be done without mipmaps in real time, it would effectively mean calculating large portions of the entire mipmap pyramid for every pixel. There would be no visual difference, but you'd have to start measuring framerates in frames per hour.

like image 65
Thomas Avatar answered Dec 28 '22 07:12

Thomas