As the textured surface moves farther away, the texture being applied switches to the prefiltered smaller size. Mipmapping avoids this by prefiltering the texture and storing it in smaller sizes down to a single pixel. This would necessitate reading all of its texels and combining their values to correctly determine the pixel color, a prohibitively expensive operation. It is also highly beneficial for cache coherency - without it the memory access pattern during sampling from distant textures will exhibit extremely poor locality, adversely affecting performance even if no filtering is performed.ĭuring texture magnification, the number of texels that need to be looked up for any pixel is always four or fewer during minification, however, as the textured polygon moves farther away potentially the entire texture might fall into a single pixel. Mipmapping is a standard technique used to save some of the filtering work needed during texture minification. Hence some form of filtering is still required. It may be misaligned or rotated, and cover parts of up to four neighboring texels. Note that even in the case where the pixels and texels are exactly the same size, one pixel will not necessarily match up exactly to one texel. Graphics APIs such as OpenGL allow the programmer to set different choices for minification and magnification filters. In this case an appropriate color has to be picked based on the covered texels, via texture minification. Farther away, each texel is smaller than a pixel, and so one pixel covers multiple texels. Closer than that, the texels are larger than screen pixels, and need to be scaled up appropriately - a process known as texture magnification. Given a square texture mapped on to a square surface in the world, at some viewing distance the size of one screen pixel is exactly the same as one texel. These depend on the position of the textured surface relative to the viewer, and different forms of filtering are needed in each case. There can be different types of correspondence between a pixel and the texel/texels it represents on the screen. Insufficient or incorrect filtering will show up in the image as artifacts (errors in the image), such as 'blockiness', jaggies, or shimmering. Some form of filtering has to be applied to determine the best color for the pixel. In other words, since the textured surface may be at an arbitrary distance and orientation relative to the viewer, one pixel does not usually correspond directly to one texel. Such a position may not lie perfectly on the "pixel grid," necessitating some function to account for these cases. For texture-mapped polygonal surfaces composed of triangles typical of most surfaces in 3D games and movies, every pixel (or subordinate pixel sample) of that surface will be associated with some triangle(s) and a set of barycentric coordinates, which are used to provide a position within a texture. There are many methods of texture filtering, which make different trade-offs between computational complexity, memory bandwidth and image quality.ĭuring the texture mapping process for any arbitrary 3D surface, a texture lookup takes place to find out where on the texture each pixel center falls. Depending on the situation, texture filtering is either a type of reconstruction filter where sparse data is interpolated to fill gaps (magnification), or a type of anti-aliasing (AA) where texture samples exist at a higher frequency than required for the sample frequency needed for texture fill (minification).
There are two main categories of texture filtering: magnification filtering and minification filtering. For most common interactive graphical applications, modern texture filtering is performed by dedicated hardware which optimizes memory access through memory cacheing and pre-fetch, and implements a selection of algorithms available to the user and developer. with either real time or GPU accelerated rendering circuits, or in a mixture of both. Depending on the circumstances, filtering can be performed in software (such as a software rendering package) or in hardware, eg. Depending on the chosen filter algorithm, the result will show varying degrees of blurriness, detail, spatial aliasing, temporal aliasing and blocking. pixels of the texture).įiltering describes how a texture is applied at many different shapes, size, angles and scales. In computer graphics, texture filtering or texture smoothing is the method used to determine the texture color for a texture mapped pixel, using the colors of nearby texels (ie. Method used to determine the texture color for a texture mapped pixel in computer graphics