TA Toolbox Home / TA Glossary

Mipmap: Principles, Purpose, and Optimization

2026-08-24

What is a Mipmap

A Mipmap is a texture preprocessing technique that generates a series of progressively lower-resolution versions of the same texture. During rendering, the appropriate Mipmap level is selected based on the object's on-screen size, reducing aliasing and moiré patterns while improving cache efficiency. Mipmaps are widely used in real-time rendering and are an essential part of texture filtering.

Principles of Mipmapping

When an object moves away from the camera, it occupies fewer pixels on screen. If the original high-resolution texture is still used, multiple texels map to a single screen pixel, causing undersampling and leading to aliasing and shimmering (moiré). Mipmaps pre-generate lower-resolution versions (each level half the size, e.g., 256x256, 128x128, 64x64...). During rendering, the level matching the screen pixel density is selected, ensuring approximately one texel per screen pixel, thus eliminating artifacts.

Generation and Storage

Mipmaps are typically generated automatically by the engine or tools during texture import. The next level is produced by filtering the previous level (e.g., averaging, box filter, or higher-quality Kaiser filter). The Mipmap chain increases memory usage by about 33% (the total area of all levels is roughly 4/3 of the original texture).

On the GPU, Mipmap levels are stored as a texture array. During sampling, the hardware automatically computes the appropriate level using texture coordinate derivatives (ddx/ddy), or trilinear filtering interpolates between adjacent levels.

Texture Filtering and Mipmaps

Mipmaps work with texture filtering:

  • **Bilinear Filtering**: Performs bilinear interpolation within a single Mipmap level.
  • **Trilinear Filtering**: Interpolates between two adjacent Mipmap levels for smoother transitions, but with slightly higher performance cost.
  • **Anisotropic Filtering**: Handles blurring on oblique surfaces, working with Mipmaps to provide sharper textures.

In shaders, you can manually specify the Mipmap level using `tex2Dlod` or `textureLod` for special effects.

Benefits and Considerations

**Benefits**:

  • Reduces aliasing and moiré on distant objects.
  • Improves texture cache hit rate, boosting performance.
  • Reduces bandwidth usage because lower-resolution textures are sampled.

**Considerations**:

  • Memory increases by ~33%, which may be a trade-off on memory-constrained platforms (like mobile).
  • Some textures (UI, precise patterns) may not be suitable for Mipmaps as they can cause blur.
  • Incorrect Mipmap generation may cause texture shifts or brightness changes (should be handled in linear space).

FAQ

How much memory do Mipmaps consume?

The total area of all Mipmap levels is about 4/3 of the original texture, i.e., a ~33% memory increase. For example, a 1024x1024 texture's Mipmap chain totals about 1.33MB (assuming 1 byte per pixel).

Why do distant objects shimmer?

Without Mipmaps, distant objects sample high-resolution textures causing undersampling, leading to shimmering. Enabling Mipmaps selects lower-resolution levels, eliminating the effect.

What is the relationship between Mipmaps and LOD?

Mipmaps are the texture LOD (Level of Detail), similar to mesh LOD. Both adjust detail based on distance to optimize performance.

How to generate Mipmaps?

In Unity, check "Generate Mip Maps" when importing a texture; in Unreal, Mipmaps are generated by default. You can also generate them manually with image software or APIs.

Should Mipmaps be used on mobile?

Mobile platforms have limited memory, but Mipmaps improve performance. It is generally recommended to enable Mipmaps for 3D scene textures, but you can limit the highest level or use compressed formats.

FAQ

How much memory do Mipmaps consume?

The total area of all Mipmap levels is about 4/3 of the original texture, i.e., a ~33% memory increase.

Why do distant objects shimmer?

Without Mipmaps, distant objects sample high-resolution textures causing undersampling, leading to shimmering. Enabling Mipmaps selects lower-resolution levels, eliminating the effect.

What is the relationship between Mipmaps and LOD?

Mipmaps are the texture LOD (Level of Detail), similar to mesh LOD. Both adjust detail based on distance to optimize performance.

How to generate Mipmaps?

In Unity, check "Generate Mip Maps" when importing a texture; in Unreal, Mipmaps are generated by default. You can also generate them manually with image software or APIs.

Should Mipmaps be used on mobile?

Mobile platforms typically recommend enabling Mipmaps for 3D scene textures, but consider memory; you can limit levels or use compressed formats.