English subtitles

← Mipmapping - Interactive 3D Graphics

Get Embed Code
2 Languages

Showing Revision 2 created 05/24/2016 by Udacity Robot.

  1. With magnification we've found that if a texel covered too many pixels, we
  2. could just make our original checkered texter larger and larger so that about
  3. one texel covered one pixel. With minification we'd like each pixel to cover no
  4. more than one texel. The GPU has built into it, special functionality that
  5. implements an algorithm called mip mapping. With mip mapping the GPU computes
  6. approximately what the texel to pixel ratio is. If this ratio is less than one
  7. Magnification happens and the mag filter takes effect. If this ratio is greater
  8. than one, minification is happening. This is where mid mapping comes in. What
  9. the GPU does, is determines the ratio of texels to pixels. If this ratio gets
  10. much larger than one to one A lower resolution version of the texture is used
  11. instead. As this ratio gets higher and higher, a lower and lower resolution of
  12. the texture gets used. These textures can be thought of as forming a pyramid.
  13. For example, say a pixel needs the texture color. Instead of taking whatever
  14. texel happens to cover the center of the pixel down at the bottom level. The
  15. GPU determines the texel to pixel ratio for this pixel to see how high up the
  16. pyramid to go. The texture at this level of the pyramid is then sampled. Since
  17. the ratio of texels to pixels is about one to one for this lower resolution
  18. texture, the rendering looks much better without the noise we saw before. In
  19. fact, for even better quality rendering, we can set the GPU to linearly
  20. interpolate between levels. This is called trilinear filtering. Say our ratio
  21. is in between two pyramid levels. We then sample the texture above and below
  22. from where our sample is in the pyramid, and interpolate between these two
  23. samples. My example pyramid was not drawn to scale. Within the GPU, the pyramid
  24. is created and stored in powers of 2. That is, if you start with a texture
  25. that's 64 by 64, the pyramid is formed with this texture, a 32 by 32 texture, a
  26. 16 by 16 texture, 8 by 8. Four by four, two by two and one by one at the end.
  27. This sort of textures is called the mipmap pyramid or the mipmap chain. Each
  28. smaller texture is derived from the larger one. One technique is to simply
  29. average the four texels of the larger texture to make the smaller which can be
  30. done in advance or by the GPU itself. There are some subtleties, such as gamma
  31. correction, that can change how these levels are formed. That's for a later
  32. lesson. This is an important point, so pay attention. You want to make your
  33. textures to be powers of two in size, both in rows and columns. You will not be
  34. able to use mipmapping if you don't. GPUs generally expect powers of two, so
  35. don't disappoint them, unless you know what you're doing and have a very good
  36. reason for doing so. Give the new version of the demo a try. You can now pick
  37. mipmapping as a filtering option for minification.