Texture Filtering
Now that you know the basics of color depth, textures, alpha blending and dithering from reading our Video Basics guide, let's dig a little deeper into the world of 3D gaming. What the heck is MIP mapping? LOD? Why is everyone filtering, and what's the difference between Bilinear, Trilinear, and Anisotrophic filtering anyway? Anti-Aliasing? We'll answer all these questions and even throw in a bonus guide on lighting and shading.
Texture Filtering
Dealing with textures is tough. They may seem pretty simple when you're just staring at a 128 x 128 mipmap, but they tend to get difficult once you apply them to polygons in a 3D environment. There, the polygons are no longer the easy-to-calculate square mipmaps. More often than not, you end up with a screenful of irregular triangles, and these triangles aren't easy to texture.
What happens when a 3D calculation gives a textel an impossible location, where the x and/or y coordinate isn't an integer? You can't just place the textel in its calculated position; you can only plot whole points.
Point Sampling
You're going to have to plot the texel at the nearest whole point. This is called point sampling. With point sampling, the texel whose coordinates are nearest to the center of the calculated pixel is the one chosen. Then, the texture is mapped to pixels with similar properties. However, this leads to pixelization, where an out of place pixel stands out. Without any special filtering, a diagonal edge between two textures will probably appear jagged because the pixels along the edge won't be at their mathematically correct positions.
Pixels will be slightly out of place, yet they'll still retain their original coloring. If the picture isn't supposed to have that color at that exact pixel, it's going to be even more noticeable. Additionally, there is a "shimmery" look when using point-sampling, because only a single texel is sampled. This is very apparent when the images are animated. The later screenshots taken from 3DMark 99 illustrate the shimmery aspect of distant textures when using point sampling.
![FS 3D Guide: Filtering and Lighting [ Point sampled filtering @ 640 x 480 ] > View Full-Size in another window.](images/pointsample-s.jpg) Point sampled filtering
|