# How linear interpolation works between mipmaps?

Nearest interpolation between 2 texels means to take the texel whose center is nearest to a given coordinate to draw or, in other words, the texel the coordinate is matching.

Linear interpolation between 2 texels means to mix the colors of them using more of the nearest texel and less of the others according to the distance to a certain coordinate.

Nearest interpolation between 2 mipmap levels consist in taking the mipmap whose size fits better the size of the image to draw

But I cannot understand how linear interpolation works with mipmap levels.

You might find the 1983 paper that introduced this**, i.e. Lance Williams' "Pyramidal Parametrics" informative.

You can ignore the scheme, in Figure 1, he used for the layout of the MIP maps as I doubt any hardware, at least in the last 20+ years, used that approach.

** (Actually, Williams *may* have described the technique at an earlier SIGGRAPH (1981) as part of tutorial/course but I've never been able to get hold of a copy)

Answered by Simon F on January 29, 2021

It's called trilinear interpolation. You first do a bilinear interpolation of the higher-res texture, then do a bilinear interpolation on the lower-res texture, then interpolate between the 2 results. The weight of the final interpolation is based on where between the 2 textures your Z-coordinate falls. If 0 is fully the low-res texture and 1 is fully the high-res texture, then you can use the standard glsl mix() function to combine the two:

result = (highres texture color * weight) + (lowres texture color * (1.0 - weight));


Answered by user1118321 on January 29, 2021

## Related Questions

### Is there an algorithm to bold an outline font?

2  Asked on December 23, 2021

### alternative to spherical harmonics to model radiance aproximation, optimized for real-time evaluation

0  Asked on December 14, 2021

### Transfer the texture between two different sets of uv

1  Asked on December 9, 2021

### How to retrieve data from Compute Shader to CPU?

0  Asked on November 15, 2021 by ethan-ma

### unwanted patterns in simplex noise

1  Asked on November 13, 2021 by sam-apostel

### Procedural generation of biological models

1  Asked on November 13, 2021 by daniel-cooke

### What method is used for baking grayscale curvature maps

1  Asked on November 10, 2021 by jummit

### Why are texture coordinates often called UVs?

2  Asked on August 27, 2021 by samanthaj

### Dynamic Ray-Triangle Intersection

1  Asked on August 27, 2021 by cemklkn

### Reducing artificial rings in mean curvature of mesh

1  Asked on August 27, 2021

### Fast and exact Geodesics on meshes, Backtracking confusion

1  Asked on August 27, 2021

### How to scale signed distance field fonts properly?

1  Asked on August 27, 2021 by endanke

### The ploygon width parallel to the x axis as a function of the y ordonate?

0  Asked on August 27, 2021 by hafid-boukhoulda

### Find the formulas of the middle point algorithm for drawing the parabola?

0  Asked on August 27, 2021 by mrjab

### Crystal ball rotation – I don’t get why the code works

0  Asked on August 27, 2021 by user13665

### Draw Line on Arbitrary Surface

0  Asked on August 27, 2021 by valentin-molina

### How to raytrace Bezier surfaces?

5  Asked on August 27, 2021 by luser-droog