Search

A technology, a device or an article

Patterns in the distance: why GPUs need mipmaps

A pattern can shimmer inside a polygon with a smooth edge. How mip levels, derivatives, and anisotropy relate texture detail to a pixel footprint.

Blue textile pattern receding into a blended tonal field
ITNWS AI-generated conceptual illustration. Detail blending in the distance evokes prefiltering.ITNWS · image_gen · Original ITNWS AI-generated conceptual editorial illustration

The pattern inside the surface may shimmer, although its outer edge is completely calm. Let’s imagine a canvas stretching into the distance with frequent dark and light threads. Each thread is visible up close. Farther away, they lie closer together on screen, then they turn into stripes that were not in the fabric pattern. A slight movement of the camera causes these false stripes to crawl. The video card correctly calculates the selected samples, but the selection itself no longer represents the surface fully enough. The more detailed the original drawing, the more noticeable the error in its reduction sometimes becomes.

This is a hypothetical scene, not the result of testing a specific GPU. It allows you to look at the internal contents of the polygon, leaving its geometric border aside. Additional edge-coverage samples provided by MSAA do not necessarily correct undersampling of the texture inside the polygon. Here another signal changes: the reflected surface pattern after projection. When several alternations of light and dark occur on a single pixel, one precisely selected color cannot itself tell what the average contribution of the entire small area was.

A texel exists in image coordinates, and a pixel exists in screen coordinates. There is no constant one-to-one correspondence between them. The visible area of fabric can occupy hundreds of screen pixels today and several dozen after camera movement. One screen area then covers many texels of the original image at once. This trace in texture space is called a footprint. What is important is not the literal presence of the drawn spot, but the area of the original signal that the final screen sample should represent.

The Vulkan sampling specification describes obtaining a value from a neighborhood of texels given the state of the sampler. Simple reading of an individual texel and filtered sampling are different operations. In our canvas, the question is not whether the GPU can find the correct address of a single thread. The returned color needs to be a plausible representation of the many threads already scaled down to screen scale. More computational precision in the address does not replace pre-filtering of the high-frequency pattern.

Light tone in the distance

A mip chain stores images of one texture in successively smaller scales. In a common 2D chain, each successive level cuts the width and height in half until the size approaches one texel. The reduced image must combine the details in advance with a suitable filter. Therefore, a distant region can read a few low-resolution samples instead of a huge number of samples of the original canvas. The loss of small threads here is intentional: the screen is still not able to reliably distinguish them separately.

In an idealized square image, the areas of the levels form the series 1 + 1/4 + 1/16 and so on. Its limit is 4/3 of the original area. This means that the full chain adds about a third of the texels, if the format and other conditions are the same. This is an arithmetic estimate for this geometry, not the exact VRAM consumption of any texture. Block compression, alignment, non-square dimensions, and implementation-specific storage layout change actual consumption. You can’t automatically turn a pretty fraction into a measurement of an actual application.

Khronos tutorial on generating mipmaps separately creates image levels and populates them. Specifying the number of levels when creating a resource does not mean getting meaningful reduced data. The renderer must load the prepared chain or generate it in a supported way, coordinate resource usage and make the necessary levels available for sampling. An uninitialized level does not become a blurred version of the source due to a single sampler flag. The image contains data, and sampler specifies how to access it.

As the camera moves away, a well-prepared chain allows the pattern to smoothly transition into the overall tone. But the number of the appropriate level does not follow simply from the distance to the object. We need texture coordinate scale, projection, screen resolution and surface orientation. Two adjacent polygons at the same distance can have different pattern repetitions. A texture repeated a hundred times requires a different filtering scale than the same texture stretched over the entire object once. Spatial frequency is determined by the mapping, not the name of the material.

Derivatives of texture coordinates along screen directions help evaluate this mapping locally. Conceptually, the GPU estimates how much the u and v coordinates change when moving to an adjacent screen position. After taking into account the texture dimensions, the scale is obtained in texels per pixel. A large scale means that the screen sample covers more of the original drawing. In a simplified isotropic example, a scale of 8 texels per pixel corresponds to approximately the third mip level: log2(8) = 3. This is an explanation of scale, not a complete implementation of all Vulkan rules.

If scale lies between levels, interpolation of results from neighboring levels is possible. Vulkan doc on samplers distinguishes the filter within a level, interpolation mode between mip levels, LOD offset and range limits. The word “linear” is therefore incomplete in itself: linear sampling can be a spatial sampling, or it can be a mixture of two scales. Their combination is often called trilinear 2D texture filtering, but this does not promise perfect averaging of an arbitrary footprint.

Elongated yellow footprint on an oblique terracotta checker-patterned plane
ITNWS AI-generated conceptual illustration. The footprint shape evokes anisotropy; neither scale nor samples are measured. — ITNWS · image_gen · Original ITNWS AI-generated conceptual editorial illustration

An elongated footprint

Now let’s tilt the fabric almost along the line of sight. In one screen direction, a pixel covers a small number of texels, in another – a long strip. If you select one coarse isotropic level based on the footprint’s larger dimension, fine detail across the strip will be lost unnecessarily. If you retain a fine level based on the short dimension, there will be too sparse sampling along the long side. This is how a natural reason for anisotropic filtering appears: the footprint has a shape that one identical scale in both directions represents poorly.

Anisotropic filtering uses additional elongation information and additional samples according to the supported algorithm. It is able to maintain the sharpness of an inclined surface while reducing false patterns. However, the specified maxAnisotropy is a constraint on the degree of anisotropy, rather than a universal number of reads per pixel. Implementations and specific sampling conditions vary. The device communicates its capabilities and limits, and the application must configure its sampler within those limits. “16x” by itself does not describe the entire cost per frame.

Sharpness cannot be increased indefinitely with negative LOD bias. Shifting to a more detailed level returns the high-frequency pattern, but the screen samples remain in the same places. In a static frame, the surface may look more expressive, but when moving, it may begin to flicker. Positive bias has the opposite price: stability comes with possible excessive blur. Bias changes the scale selection. It is not an independent source of new surface observations and does not recover details that the screen grid cannot represent.

An excessively coarse result sometimes appears due to the limitation of the available chain. If detailed levels have not yet been loaded during streaming, the sampler cannot read them until the data is available and accessed correctly. If there are no low-resolution levels at all, distant regions do not receive prepared averaging. Therefore, the same visible blur can relate to resource data, LOD limits, or filtering. The word itself does not establish the cause. A picture has a storage organization and a specific sampling procedure that are useful to examine together.

Implicit derivatives also have a range of applicability. In a normal fragment shader they are associated with neighboring shader invocations, usually discussed as quad. GLSL Built-in Functions Documentation warns about implicit derivatives in non-uniform control flow. Modern Vulkan contains additional features and refinements, so the old model’s short disclaimer should not be turned into a ban on all stages and extensions. A specific shader requires supported semantics and corresponding device capabilities.

The practical meaning of the clause is clearly visible without the fictitious test. If the coordinates for some neighboring invocations went through one branch of the calculation, but for another part were not obtained in a comparable way, the expectation of the usual local estimate may be incorrect. Explicitly passing gradients allows you to determine the desired coordinate changes, but the correct gradients still need to be calculated. Explicit LOD sets the scale directly and solves a different problem. Replacing one with another without preserving the meaning of the footprint means changing the filtered signal itself.

There is also a purely numerical trap: the coordinates of the repeated texture can be artificially cut off when moving from the end of the range to the beginning. If an application manually applies the fractional part before calculating derivatives, a jump near the seam can ruin the local gradient. Periodic sampler addressing and a discontinuity in explicitly transformed coordinates occur at different points in the operation. The pattern may be repeated visually correctly, but the filtering scale may be incorrect at the seam. This is an example of how a formally appropriate color near a boundary does not guarantee the correct adjacent data for the derivative.

Generating the chain requires understanding what the original channels mean. Color in nonlinear encoding and linear luminance are averaged differently. The normal map stores directions that need appropriate processing after filtering. A transparency mask may require maintaining coverage properties at different levels. One universal reduction filter can produce a technically filled chain and a visually undesirable result. Mipmaps define the organization of scales, but do not relieve the resource creator from understanding what exactly is written in the texels.

Changing the screen resolution also changes the footprint. The same fixed camera at a lower resolution provides the surface with fewer pixels, so it often requires a coarser scale. Dynamic resolution interacts with LOD and subsequent reconstruction; the result cannot be explained solely by the physical distance to the fabric. Additional temporal techniques can reduce flicker, but do not eliminate the need to select the correct spatial signal. A random accumulation of bad samples is not the same as a well-prepared averaging.

In the illustration for the article, the distant drawing dissolves in a blue tone. This is a conceptual image and not a reference render or evidence of correct operation for a specific sampler. The meaning of the transition remains precise: moving away should change how the detail is represented before too-sparse sampling creates a new false pattern. Well-chosen filtering preserves the character of the surface at the cost of details that can no longer exist consistently on the screen. The reduced texture here helps the fabric to be seen rather than simply making the original image less sharp.

Available image levels are also set via image view. Even a correctly populated full chain may only be partially shown to the shader. The base level of such a view and the allowed number of levels participate in the selection together with the sampler. This is a useful separation of concerns: the resource stores scale variations, the view defines the visible range, and sampling accesses it according to established rules. When looking for the cause of unexpected sharpness or blur, it is important to maintain this connection rather than looking for one magical quality setting.

Sources verified October 26, 2026. The hypothetical fabric remained the same in the foreground and the distance. The area that the screen can discern has changed. In a close area, the color belongs to individual threads, in the distance – to their total contribution. It is this transition, with the shape of the footprint and the available scales, that explains the need for mip filtering better than the promise of always choosing the most detailed version of the image.

Sources & documentation

  1. Vulkan sampling specification ↗
  2. Vulkan samplers specification ↗
  3. Vulkan GLSL derivatives ↗
  4. Vulkan generating mipmaps tutorial ↗
  5. Vulkan mipmaps and LOD tutorial ↗