Trilinear Filtering
   HOME

TheInfoList



OR:

Trilinear filtering is an extension of the bilinear
texture filtering In computer graphics, texture filtering or texture smoothing is the method used to determine the texture color for a Texture mapping, texture mapped pixel, using the colors of nearby Texel (graphics), texels (ie. pixels of the texture). Filtering ...
method, which also performs
linear interpolation In mathematics, linear interpolation is a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points. Linear interpolation between two known points If the two known po ...
between mipmaps. Bilinear filtering has several weaknesses that make it an unattractive choice in many cases: using it on a full-detail texture when scaling to a very small size causes accuracy problems from missed
texels In Computer graphics, computer graphics, a texel, texture element, or texture pixel is the fundamental unit of a texture maps, texture map. Textures are represented by Array (data structure), arrays of texels representing the texture space, just ...
, and compensating for this by using multiple mipmaps throughout the polygon leads to abrupt changes in blurriness, which is most pronounced in polygons that are steeply angled relative to the camera. To solve this problem, trilinear filtering interpolates between the results of bilinear filtering on the two mipmaps nearest to the detail required for the polygon at the pixel. If the pixel would take up 1/100 of the texture in one direction, trilinear filtering would interpolate between the result of filtering the 128×128 mipmap as y1 with x1 as 128, and the result of filtering on the 64×64 mipmap as y2 with x2 as 64, and then interpolate to . The first step in this process is to determine how big in terms of the texture the pixel in question is. There are a few ways to do this, and the ones mentioned here are not necessarily representative of all of them. * Use the distance along the texture between the current pixel and the pixel to its right (or left, or above, or below) as the size of the pixel. * Use the smallest (or biggest, or average) of the various sizes determined by using the above method. * Determine the uv-values of the corners of the pixel, use those to calculate the area of the pixel, and figure out how many pixels of exactly the same size would take up the whole texture. Once this is done, bilinear filtering is carried out on the two mipmaps with pixel sizes that are immediately larger and smaller than the calculated size of the pixel, and then interpolate between them as normal. Since it uses both larger and smaller mipmaps, trilinear filtering cannot be used in places where the pixel is smaller than a texel on the original texture, because mipmaps larger than the original texture are not defined. Bilinear filtering still works, and can be used in these situations without worrying too much about abruptness because bilinear and trilinear filtering provide the same result when the pixel size is exactly the same as the size of a texel on the appropriate mipmap. Trilinear filtering still has weaknesses, because the pixel is still assumed to take up a square area on the texture. In particular, when a texture is at a steep angle compared to the camera, detail can be lost because the pixel actually takes up a narrow but long trapezoid: in the narrow direction, the pixel is getting information from more texels than it actually covers (so details are smeared), and in the long direction the pixel is getting information from fewer texels than it actually covers (so details fall between pixels). To alleviate this,
anisotropic Anisotropy () is the structural property of non-uniformity in different directions, as opposed to isotropy. An anisotropic object or pattern has properties that differ according to direction of measurement. For example, many materials exhibit ver ...
("direction dependent") filtering can be used.


References

{{reflist, refs= {{cite web , last1=Wilde , first1=Tyler , title=PC graphics options explained , url=https://www.pcgamer.com/pc-graphics-options-explained/3/ , website=
PC Gamer ''PC Gamer'' is a magazine and website founded in the United Kingdom in 1993 devoted to PC gaming and published monthly by Future plc. The magazine has several regional editions, with the UK and US editions becoming the best selling PC games m ...
, access-date=3 February 2024 , language=en , date=13 March 2019
{{cite magazine , date=August 2004 , title=Fine-tune your graphics , url=https://books.google.com/books?id=2QEAAAAAMBAJ&pg=PA30 , magazine=
Maximum PC ''Maximum PC'', formerly known as ''boot'', was an American magazine and website published by Future US. It focuses on cutting-edge PC hardware, with an emphasis on product reviews, step-by-step tutorials, and in-depth technical briefs. Compon ...
, publisher= , access-date= 3 February 2024
{{cite book , last1=Pulli , first1=Kari , last2=Aarnio , first2=Tomi , last3=Miettinen , first3=Ville , last4=Romeia , first4=Kimmo , last5=Vaarala , first5=Jani , title=Mobile 3D Graphics With OpenGL ES and M3G , date=19 November 2007 , publisher=
Elsevier Science Elsevier ( ) is a Dutch academic publishing company specializing in scientific, technical, and medical content. Its products include journals such as ''The Lancet'', '' Cell'', the ScienceDirect collection of electronic journals, '' Trends'', t ...
, isbn=978-0-08-055591-1


See also

* Bilinear filtering *
Anisotropic filtering In 3D computer graphics, anisotropic filtering (AF) is a technique that improves the appearance of Texture filtering, textures, especially on surfaces viewed at sharp Viewing angle, angles. It helps make textures look sharper and more detailed ...
*
Trilinear interpolation Trilinear interpolation is a method of multivariate interpolation on a Three dimensional space, 3-dimensional regular grid. It approximates the value of a function at an intermediate point (x, y, z) within the local axial rectangular prism (geo ...
*
Lanczos resampling Lanczos filtering and Lanczos resampling are two applications of a certain mathematical formula. It can be used as a low-pass filter or used to smoothly interpolate the value of a digital signal between its samples. In the latter case, it maps ...
Texture filtering