Skip to content

Textures & Sampling

Wrap, filter and mip a texture, and see what each sampler setting actually costs you.

What you should come away with: Why a texture looks wrong at a distance, and what mipmapping is really trading away.

Assumes: Coordinate Spaces. It will still make sense without it, but that one comes first.

  • orientation marker
  • tile edge
mipmaps on

What the sampler is doing

texture
256²
mip levels
9
tiles across
6.0
wrap
R / R

The far end of this plane compresses hundreds of texels into one pixel. A sampler with no mip chain has to pick one of them and the choice changes every frame you move — which is the shimmer. A mipmap is the same image pre-shrunk nine times, so there is always a level where one texel is about one pixel. It costs a third more memory and removes an entire class of artefact, which is why it is almost always the right default.

Where that leaves you

You can now tell magnification from minification by looking at the picture, choose a filter for a reason rather than out of habit, and say what a mip chain costs in memory and usually gives back in cache.

This did not teach you where UV coordinates come from. The plane here builds its own out of the vertex position, which no real asset does — unwrapping a mesh, the seams that costs and the atlas the pieces are packed into are decided in a modelling tool long before a sampler sees them, and nothing on this site has one.