Game Development Reference
In-Depth Information
Understanding mipmapping
First, let's understand what texture filtering and mipmapping are. Take a close look
at the following images. The image on the left shows the image of a monkey model
with aliasing effects (look at the eyes of the monkey). On the right, we have an image
of the same model with no such effects. When the object moves closer to the camera
or moves further away from it, the texture associated with that object appears blocky
or pixelated. Let's first understand why this happens. In our shader, we pass the
image coordinates of the image. Now the shader interpolates texel values (texture
pixels) and decides which pixel of the image to pick to be shaded on the screen.
When the object is close to the viewer, each texel might become larger than the screen
pixel. When the object is very far from the viewer, the screen pixel might become
larger than the texel. Now, when it comes to selecting the texel, the rendering engine
needs to decide which algorithm to follow to select the texel. The algorithms have
to be decided by us, the programmers. Each algorithm has its pros and cons. Some
are very accurate but processor-intensive, and some are inaccurate but fast. In this
section, we will learn about each of them, and then we can decide which one to use
for rendering a particular object, depending on their importance in the game. The
best part is you get to apply various filtering modes for different textures.
 
Search WWH ::




Custom Search