The Rendering PipelineSince this article is directed to people using Direct3D, I won't be getting into specific rendering algorithms, but it's always good to have a general idea of what's going on in the lower levels. In order to render a textured polygon, the rendering engine needs to know how many texels it has to advance to get to the pixel beside it, and how many to get to the line below it. For it to choose a mip-map, it checks if either of these values is greater than 1.0, which means there are texels that will potentially be skipped over, so instead, use the next level (lower resolution) mip-map. Repeat this check until the values are both less than or equal to 1.0, or the lowest resolution mip-map is reached, and you have the one that will be used. And of course, for each time the next level is selected, the texel coordinates are divided by two. This process may sound like an expensive operation, but in the rendering pipeline it can be optimized to simple non-iterative instructions. Granted though, it generally is slower than regular texture mapping (but the results are worth it!). There are also other algorithms used to figure out where the mip-maps go, such as spliting the polygons at boundries based on the surface angle and distance from the view point, but they all produce basically the same results (though some are faster in certain situations). This demonstrates where the different mip-map levels are used by inverting the texture colour at each level. Mip-maps usually can be bilinear filtered just like any other texture, but most 3D hardware also allows for a third level of linear filtering on mip-maps. This level will fade smoothly between the mip-map levels instead of having a sharp break (the break usually isn't very noticable though because you are going between two textures of the same colour composition).
|
|||||||||||