Link to home
Start Free TrialLog in
Avatar of j1lted

asked on

what are mipmaps?

what are mipmaps and why are they often used in rendering texture?
Avatar of weed
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TheBeaver

When you render a bitmapped texture, you can't display all of the information in that bitmap if it scaled down. This means that the bitmap will look blocky and may even miss vital information. In short, in a 3D environment, it looks more like a computer graphic than reality.

A mipmap is a set of the same bitmap at different sizes to eliminate most of the blockiness errors.

A classic example is that of a brickwall texture. Say that our texture is 256x256 and each row of bricks is 8 pixels tall, 7 pixels for the brick and 1 for the morter.
At full size everything looks good, but at 128x128 we are only drawing every second row of pixels. We now have 4 pixels per brick, 3 for the brick and 1 for the mortor....

100% = 256x256 = 8 pixels per brick = 1 morter + 7 brick = 12.5% morter
50% = 128x128 = 4 pixels per brick = 1 morter + 3 brick = 25% morter
25% = 64x64 = 2 pixels per brick = 1 mortor + 1 brick = 50% morter
12.5% = 32x32 = 1 prixel per brick = 1 mortor = 100 % morter

Because we are just mechanicaly pulling using every 2nd/4th/8th/etc row and the first row is morter, that minor detail dominates the bitmap at the smaller scales.

Now, if we mipmap, we can define the 128x128 image better. the best way is, for each pixel, average the color of the 2x2 pixels from the larger image.
"MIP map" is the name given to a collection of images to be used as surface textures when building, or rendering, a 2D representation of a 3D scene. The acronym "MIP" comes from the Latin phrase: multum in parvo which is translated as "many things in a small place".

Each of the many images stored in the "small place", or MIP map, holds a copy of the same texture but at a different scale from the others, each being known as a "MIP map level". The largest-scale copy of the texture is used on surfaces close to the observer's viewpoint; the next smaller-scale image is used on surfaces a little further away and so on.

Using pre-scaled versions of a single texture saves the processing time that would be required to scale-down a large texture to make it usable on a "distant" surface. Scaling of textures is still usually necessary but, by selecting the version of the texture which is closest to the required scale, the scaling process takes less time and also the possibility of errors being introduced by the scaling process, and the consequent distortion of the texture, is reduced.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.  I will leave the following recommendation for this question in the Cleanup topic area:

- Accept weed’s comment as answer

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer