Mipmap
Encyclopedia
In 3D computer graphics
texture filtering
, MIP maps (also mipmaps) are pre-calculated, optimized
collections of images that accompany a main texture, intended to increase rendering speed and reduce aliasing
artifacts. They are widely used in 3D computer games, flight simulator
s and other 3D imaging systems. The technique is known as mipmapping. The letters "MIP" in the name are an acronym of the Latin
phrase multum in parvo, meaning "much in little". Mipmaps need more space in memory. They also form the basis of wavelet compression.
in 1983 and is described in his paper Pyramidal parametrics. From the abstract: "This paper advances a 'pyramidal parametric' prefiltering and sampling geometry which minimizes aliasing effects and assures continuity within and between target images." The "pyramid" can be imagined as the set of mipmaps stacked on top of each other.
between the two nearest, if trilinear filtering
is activated) when the texture is viewed from a distance or at a small size. Rendering speed increases since the number of texture pixels ("texels
") being processed can be much lower than with simple textures. Artifacts are reduced since the mipmap images are effectively already anti-aliased
, taking some of the burden off the real-time renderer.
Scaling down and up is made more efficient with mipmaps as well.
If the texture has a basic size of 256 by 256 pixels, then the associated mipmap set may contain a series of 8 images, each one-fourth the total area of the previous one: 128×128 pixels, 64×64, 32×32, 16×16, 8×8, 4×4, 2×2, 1×1 (a single pixel). If, for example, a scene is rendering this texture in a space of 40×40 pixels, then either a scaled up version of the 32×32 (without trilinear interpolation) or an interpolation of the 64×64 and the 32×32 mipmaps (with trilinear interpolation) would be used. The simplest way to generate these textures is by successive averaging; however, more sophisticated algorithms (perhaps based on signal processing and Fourier transforms) can also be used.
The increase in storage space required for all of these mipmaps is a third of the original texture, because the sum of the areas 1/4 + 1/16 + 1/64 + 1/256 + · · ·
converges to 1/3. In the case of an RGB image with three channels stored as separate planes, the total mipmap can be visualized as fitting neatly into a square area twice as large as the dimensions of the original image on each side (four times the original area - one square for each channel, then increase subtotal that by a third). This is the inspiration for the tag "multum in parvo".
In many instances, the filtering should not be uniform in each direction (it should be anisotropic, as opposed to isotropic), and a compromise resolution is used. If a higher resolution is used, the cache coherence
goes down, and the aliasing is increased in one direction, but the image tends to be clearer. If a lower resolution is used, the cache coherence is improved, but the image is overly blurry, to the point where it becomes difficult to identify.
To help with this problem, nonuniform mipmaps (also known as rip-maps) are sometimes used, although there is no direct support for this method on modern graphics hardware. With a 16×16 base texture map, the rip-map resolutions would be 16×8, 16×4, 16×2, 16×1, 8×16, 8×8, 8×4, 8×2, 8×1, 4×16, 4×8, 4×4, 4×2, 4×1, 2×16, 2×8, 2×4, 2×2, 2×1, 1×16, 1×8, 1×4, 1×2 and 1×1. In the general case, for a × base texture map, the rip-map resolutions would be × for i, j in 0,1,2,...,n.
were conceived. However, this approach tends to exhibit poor cache
behavior. Also, a summed-area table needs to have wider types to store the partial sums than the word size used to store the texture. For these reasons, there isn't any hardware that implements summed-area tables today.
A compromise has been reached today, called anisotropic mip-mapping. In the case where an anisotropic filter
is needed, a higher resolution mipmap is used, and several texels are averaged in one direction to get more filtering in that direction. This has a somewhat detrimental effect on the cache, but greatly improves image quality.
3D computer graphics
3D computer graphics are graphics that use a three-dimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images...
texture filtering
Texture filtering
In computer graphics, texture filtering or texture smoothing is the method used to determine the texture color for a texture mapped pixel, using the colors of nearby texels . Mathematically, texture filtering is a type of anti-aliasing, but it filters out high frequencies from the texture fill...
, MIP maps (also mipmaps) are pre-calculated, optimized
Optimization (computer science)
In computer science, program optimization or software optimization is the process of modifying a software system to make some aspect of it work more efficiently or use fewer resources...
collections of images that accompany a main texture, intended to increase rendering speed and reduce aliasing
Aliasing
In signal processing and related disciplines, aliasing refers to an effect that causes different signals to become indistinguishable when sampled...
artifacts. They are widely used in 3D computer games, flight simulator
Flight simulator
A flight simulator is a device that artificially re-creates aircraft flight and various aspects of the flight environment. This includes the equations that govern how aircraft fly, how they react to applications of their controls and other aircraft systems, and how they react to the external...
s and other 3D imaging systems. The technique is known as mipmapping. The letters "MIP" in the name are an acronym of the Latin
Latin
Latin is an Italic language originally spoken in Latium and Ancient Rome. It, along with most European languages, is a descendant of the ancient Proto-Indo-European language. Although it is considered a dead language, a number of scholars and members of the Christian clergy speak it fluently, and...
phrase multum in parvo, meaning "much in little". Mipmaps need more space in memory. They also form the basis of wavelet compression.
Origin
Mipmapping was invented by Lance WilliamsLance Williams
Lance J. Williams is a prominent graphics researcher who made major contributions to texture map prefiltering, shadow rendering algorithms, facial animation, and antialiasing techniques...
in 1983 and is described in his paper Pyramidal parametrics. From the abstract: "This paper advances a 'pyramidal parametric' prefiltering and sampling geometry which minimizes aliasing effects and assures continuity within and between target images." The "pyramid" can be imagined as the set of mipmaps stacked on top of each other.
How it works
Each bitmap image of the mipmap set is a version of the main texture, but at a certain reduced level of detail. Although the main texture would still be used when the view is sufficient to render it in full detail, the renderer will switch to a suitable mipmap image (or in fact, interpolateInterpolation (computer programming)
In the context of computer animation, interpolation refers to inbetweening, or filling in frames between the key frames. It typically calculates the inbetween frames through use of piecewise polynomial interpolation to draw images semi-automatically....
between the two nearest, if trilinear filtering
Trilinear filtering
Trilinear filtering is an extension of the bilinear texture filtering method, which also performs linear interpolation between mipmaps.Bilinear filtering has several weaknesses that make it an unattractive choice in many cases: using it on a full-detail texture when scaling to a very small size...
is activated) when the texture is viewed from a distance or at a small size. Rendering speed increases since the number of texture pixels ("texels
Texel (graphics)
A texel, or texture element is the fundamental unit of texture space, used in computer graphics. Textures are represented by arrays of texels, just as pictures are represented by arrays of pixels....
") being processed can be much lower than with simple textures. Artifacts are reduced since the mipmap images are effectively already anti-aliased
Anti-aliasing
In digital signal processing, spatial anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution image at a lower resolution...
, taking some of the burden off the real-time renderer.
Scaling down and up is made more efficient with mipmaps as well.
If the texture has a basic size of 256 by 256 pixels, then the associated mipmap set may contain a series of 8 images, each one-fourth the total area of the previous one: 128×128 pixels, 64×64, 32×32, 16×16, 8×8, 4×4, 2×2, 1×1 (a single pixel). If, for example, a scene is rendering this texture in a space of 40×40 pixels, then either a scaled up version of the 32×32 (without trilinear interpolation) or an interpolation of the 64×64 and the 32×32 mipmaps (with trilinear interpolation) would be used. The simplest way to generate these textures is by successive averaging; however, more sophisticated algorithms (perhaps based on signal processing and Fourier transforms) can also be used.
The increase in storage space required for all of these mipmaps is a third of the original texture, because the sum of the areas 1/4 + 1/16 + 1/64 + 1/256 + · · ·
1/4 + 1/16 + 1/64 + 1/256 + · · ·
In mathematics, the infinite series 1/4 + 1/16 + 1/64 + 1/256 + · · · is an example of one of the first infinite series to be summed in the history of mathematics; it was used by Archimedes circa 250–200 BC. Its sum is 1/3...
converges to 1/3. In the case of an RGB image with three channels stored as separate planes, the total mipmap can be visualized as fitting neatly into a square area twice as large as the dimensions of the original image on each side (four times the original area - one square for each channel, then increase subtotal that by a third). This is the inspiration for the tag "multum in parvo".
In many instances, the filtering should not be uniform in each direction (it should be anisotropic, as opposed to isotropic), and a compromise resolution is used. If a higher resolution is used, the cache coherence
Cache coherence
In computing, cache coherence refers to the consistency of data stored in local caches of a shared resource.When clients in a system maintain caches of a common memory resource, problems may arise with inconsistent data. This is particularly true of CPUs in a multiprocessing system...
goes down, and the aliasing is increased in one direction, but the image tends to be clearer. If a lower resolution is used, the cache coherence is improved, but the image is overly blurry, to the point where it becomes difficult to identify.
To help with this problem, nonuniform mipmaps (also known as rip-maps) are sometimes used, although there is no direct support for this method on modern graphics hardware. With a 16×16 base texture map, the rip-map resolutions would be 16×8, 16×4, 16×2, 16×1, 8×16, 8×8, 8×4, 8×2, 8×1, 4×16, 4×8, 4×4, 4×2, 4×1, 2×16, 2×8, 2×4, 2×2, 2×1, 1×16, 1×8, 1×4, 1×2 and 1×1. In the general case, for a × base texture map, the rip-map resolutions would be × for i, j in 0,1,2,...,n.
A trade off : anisotropic mip-mapping
Mipmaps require 33% more memory than a single texture. To reduce the memory requirement, and simultaneously give more resolutions to work with, summed-area tablesSummed Area Table
A summed area table is an algorithm for quickly and efficiently generating the sum of values in a rectangular subset of a grid...
were conceived. However, this approach tends to exhibit poor cache
Cache
In computer engineering, a cache is a component that transparently stores data so that future requests for that data can be served faster. The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere...
behavior. Also, a summed-area table needs to have wider types to store the partial sums than the word size used to store the texture. For these reasons, there isn't any hardware that implements summed-area tables today.
A compromise has been reached today, called anisotropic mip-mapping. In the case where an anisotropic filter
Anisotropic filtering
In 3D computer graphics, anisotropic filtering is a method of enhancing the image quality of textures on surfaces that are at oblique viewing angles with respect to the camera where the projection of the texture appears to be non-orthogonal In 3D computer graphics, anisotropic filtering...
is needed, a higher resolution mipmap is used, and several texels are averaged in one direction to get more filtering in that direction. This has a somewhat detrimental effect on the cache, but greatly improves image quality.
See also
- Anti-aliasingAnti-aliasingIn digital signal processing, spatial anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution image at a lower resolution...
- Anisotropic filteringAnisotropic filteringIn 3D computer graphics, anisotropic filtering is a method of enhancing the image quality of textures on surfaces that are at oblique viewing angles with respect to the camera where the projection of the texture appears to be non-orthogonal In 3D computer graphics, anisotropic filtering...
- Hierarchical modulationHierarchical modulationHierarchical modulation, also called layered modulation, is one of the signal processing techniques for multiplexing and modulating multiple data streams into one single symbol stream, where base-layer symbols and enhancement-layer symbols are synchronously overplayed before...
– similar technique in broadcasting - Scale spaceScale spaceScale-space theory is a framework for multi-scale signal representation developed by the computer vision, image processing and signal processing communities with complementary motivations from physics and biological vision...