Texture filtering: Difference between revisions
LilShootDawg (talk | contribs) grammar |
FosterHaven (talk | contribs) m table cleanup |
||
| Line 1: | Line 1: | ||
[[File:Nearest_Neighbor_2x_versus_HQ2x.png|thumb|A comparison between nearest neighbor scaling and HQ2x scaling]] | [[File:Nearest_Neighbor_2x_versus_HQ2x.png|thumb|300px|A comparison between nearest neighbor scaling and HQ2x scaling]] | ||
In computer graphics, '''texture filtering''' or texture smoothing is the method used to smooth textures used in 3D models. Some consoles use texture filtering. | In computer graphics, '''texture filtering''' or texture smoothing is the method used to smooth textures used in 3D models. Some consoles use texture filtering. | ||
| Line 6: | Line 6: | ||
==Consoles== | ==Consoles== | ||
{| class="wikitable" | {| class="wikitable" style="text-align:center;" | ||
! scope="col"|Console | ! scope="col"|Console | ||
! scope="col | ! scope="col"|Texture Filtering | ||
! scope="col | ! scope="col"|Types of filtering | ||
|- | |- | ||
|[[Super Nintendo emulators|Super Nintendo]] | | style="text-align:left;" |[[Super Nintendo emulators|Super Nintendo]] | ||
|✗ | |||
| | |||
|- | |- | ||
|[[3DO emulators|3DO]] | | style="text-align:left;" |[[3DO emulators|3DO]] | ||
|✗ | |||
|? | |||
|- | |- | ||
|[[Atari Jaguar emulators|Atari Jaguar]] | | style="text-align:left;" |[[Atari Jaguar emulators|Atari Jaguar]] | ||
|✗ | |||
| | |||
|- | |- | ||
|[[Sega Saturn emulators|Sega Saturn]] | | style="text-align:left;" |[[Sega Saturn emulators|Sega Saturn]] | ||
|✗ | |||
| | |||
|- | |- | ||
|[[PlayStation emulators|PlayStation]] | | style="text-align:left;" |[[PlayStation emulators|PlayStation]] | ||
|✗ | |||
| | |||
|- | |- | ||
|[[Nintendo 64 emulators|Nintendo 64]] | | style="text-align:left;" |[[Nintendo 64 emulators|Nintendo 64]] | ||
|✓ | |||
|Three-sample | |||
|- | |- | ||
|[[Sega Dreamcast emulators|Sega Dreamcast]] | | style="text-align:left;" |[[Sega Dreamcast emulators|Sega Dreamcast]] | ||
|✓ | |||
|Bilinear, trilinear, anisotropic | |||
|- | |- | ||
|[[PlayStation 2 emulators|PlayStation 2]] | | style="text-align:left;" |[[PlayStation 2 emulators|PlayStation 2]] | ||
|✓ | |||
|Bilinear, trilinear, Anisotropic | |||
|- | |- | ||
|[[GameCube emulators|GameCube]] | | style="text-align:left;" |[[GameCube emulators|GameCube]] | ||
|✓ | |||
|Bilinear, trilinear, anisotropic | |||
|- | |- | ||
|[[Xbox emulators|Xbox]] | | style="text-align:left;" |[[Xbox emulators|Xbox]] | ||
|✓ | |||
|Bilinear, trilinear, anisotropic | |||
|- | |- | ||
|[[Nintendo DS emulators|Nintendo DS]] | | style="text-align:left;" |[[Nintendo DS emulators|Nintendo DS]] | ||
|✗ | |||
|? | |||
|- | |- | ||
|[[PlayStation Portable emulators|PlayStation Portable]] | | style="text-align:left;" |[[PlayStation Portable emulators|PlayStation Portable]] | ||
|✓ | |||
|Bilinear, trilinear | |||
|- | |- | ||
|[[Wii emulators|Wii]] | | style="text-align:left;" |[[Wii emulators|Wii]] | ||
|✓ | |||
|Bilinear, trilinear, anisotropic | |||
|} | |} | ||
==Types of Texture Filtering== | ==Types of Texture Filtering== | ||
{| class="wikitable | {| class="wikitable" style="text-align:center;" | ||
! scope="col"|Filtering type | |||
! scope="col | ! scope="col"|What it does | ||
! scope="col | ! scope="col"|Pros | ||
! scope="col | ! scope="col"|Cons | ||
|- | |- | ||
|'''Nearest neighbor''' | |||
|This method sorts pixels into the nearest place relevant to its placement in the original resolution, in order to display the image at whatever resolution you specify. | |||
| | |||
*Very fast. | *Very fast. | ||
*At integer values (eg, exactly double or quadruple resolution) it's practically "unfiltered". | *At integer values (eg, exactly double or quadruple resolution) it's practically "unfiltered". | ||
| | |||
*Unfiltered pixels tend to look odd, with some being thicker than others. This can result in pixel art losing clarity, and text may become hard to read. | *Unfiltered pixels tend to look odd, with some being thicker than others. This can result in pixel art losing clarity, and text may become hard to read. | ||
|- | |- | ||
|'''Bilinear''' | |||
|This linear filtering method uses color data from the pixels in a nearest-neighbor texture, and combines multiple bits of color data in order to replace some of the pixels with an averaged-out version of the colors, so that the colors gradually switch rather than jump to a new color. | |||
| | |||
*Looks better than nearest neighbor for 3D games. | *Looks better than nearest neighbor for 3D games. | ||
*It's the least system-intensive form of texture filtering/scaling. | *It's the least system-intensive form of texture filtering/scaling. | ||
| | |||
*At low resolutions, 2D games tend to become very blurry. This is especially noticeable in 2D games, and low res 3D games. | *At low resolutions, 2D games tend to become very blurry. This is especially noticeable in 2D games, and low res 3D games. | ||
*If you have the hardware to do so, look into more complex filtering methods to preserve clarity. | *If you have the hardware to do so, look into more complex filtering methods to preserve clarity. | ||
|- | |- | ||
|'''Trilinear''' | |||
|This linear filtering method does the same thing as bilinear filtering, except it passes through twice, giving a smoother gradient. | |||
| | |||
*Looks better than bilinear filtering for 3D games. | *Looks better than bilinear filtering for 3D games. | ||
| | |||
*As with bilinear, low-resolution games will more than likely appear overly blurry using this method. | *As with bilinear, low-resolution games will more than likely appear overly blurry using this method. | ||
|- | |- | ||
|'''HQx''' | |||
|A texture scaling algorithm. Scales up a nearest-neighbor version of the texture and fills in the gaps with copies of the pixels next to said gaps. | |||
| | |||
*While it is inherently destructive, some games (eg. Yoshi's Island) may benefit from this filter, as it preserves the cartoony look. | *While it is inherently destructive, some games (eg. Yoshi's Island) may benefit from this filter, as it preserves the cartoony look. | ||
| | |||
*Artifacts are common. | *Artifacts are common. | ||
*Curves and slopes that aren't 45° look jagged compared to everything else. | *Curves and slopes that aren't 45° look jagged compared to everything else. | ||
| Line 107: | Line 107: | ||
*Worse at some things that xBR excels at. | *Worse at some things that xBR excels at. | ||
|- | |- | ||
|'''2xSaI''' | |||
|A texture scaling algorithm. Scales the texture and fills edges in with a mixture of pixels taken from the source and randomly-guessed colors. | |||
| | |||
*Less system-intensive than HQx and xBR. | *Less system-intensive than HQx and xBR. | ||
*Adequate if it's the best option available (e.g. in Pete's OpenGL2 plugin for PSX emulators). | *Adequate if it's the best option available (e.g. in Pete's OpenGL2 plugin for PSX emulators). | ||
| | |||
*Edge detection is horrible. | *Edge detection is horrible. | ||
*Artifacts are common. | *Artifacts are common. | ||
| Line 118: | Line 118: | ||
*Archaic. The alternatives are much better. | *Archaic. The alternatives are much better. | ||
|- | |- | ||
|'''xBR''' | |||
|A modified version of HQx. It detects edges better, which works better for curved lines, or for slopes that are greater than/less than 45 degrees. | |||
| | |||
*Looks great for many 2D games. | *Looks great for many 2D games. | ||
*Edge detection is improved over HQx. This gives textures smoother curves and slopes, as well as fewer artifacts. | *Edge detection is improved over HQx. This gives textures smoother curves and slopes, as well as fewer artifacts. | ||
*3D games look great with it as well. | *3D games look great with it as well. | ||
| | |||
*Posterization is common. There are deposterization filters in some emulators (e.g. PPSSPP) that can aid this, however. | *Posterization is common. There are deposterization filters in some emulators (e.g. PPSSPP) that can aid this, however. | ||
*The finer details of the textures/sprites might be obscured by bad edge detection. | *The finer details of the textures/sprites might be obscured by bad edge detection. | ||
*Worse at some things that HQx excels at. | *Worse at some things that HQx excels at. | ||
|- | |- | ||
|'''xBRZ''' | |||
|A modified version of xBR, which is very similar except it's better at scaling up smaller features consisting of <10 pixels. | |||
| | |||
*Looks great for many 2D games. | *Looks great for many 2D games. | ||
*Detects small features that get messed up by HQx and xBR. | *Detects small features that get messed up by HQx and xBR. | ||
*3D games look great with it as well. | *3D games look great with it as well. | ||
| | |||
*Posterization is common. There are deposterization filters in some emulators (e.g. PPSSPP) that can aid this, however. | *Posterization is common. There are deposterization filters in some emulators (e.g. PPSSPP) that can aid this, however. | ||
*Worse at some things the other scalers excel at. | *Worse at some things the other scalers excel at. | ||