Texture filtering: Difference between revisions

Ahayri (talk | contribs)
Ahayri (talk | contribs)
 
(14 intermediate revisions by the same user not shown)
Line 4: Line 4:
'''[[wikipedia:Texture filtering|Texture filtering]]''' refers to the methods used to smooth the textures of a 3D model. Every home console after the [[Nintendo 64 emulators|Nintendo 64]] is able to do it, including every modern PC and Android device. This makes it useful in emulation, where it can be applied to emulators for consoles that did not originally have it through various emulators that support it.
'''[[wikipedia:Texture filtering|Texture filtering]]''' refers to the methods used to smooth the textures of a 3D model. Every home console after the [[Nintendo 64 emulators|Nintendo 64]] is able to do it, including every modern PC and Android device. This makes it useful in emulation, where it can be applied to emulators for consoles that did not originally have it through various emulators that support it.


==Consoles==
{| class="wikitable" style="text-align:center;"
{| class="wikitable" style="text-align:center;"
! scope="col"|Console
! scope="col"|Console
Line 63: Line 62:
|}
|}


==Types of Texture Filtering==
==Texture Filtering Algorithms==
These methods determine how a texture is sampled and displayed on a 3D model in real-time. They are generally native to original hardware or forced via emulator enhancement settings.


{| class="wikitable" style="text-align:center;"
{| class="wikitable" style="text-align:center;"
Line 72: Line 72:
|-
|-
|'''Nearest neighbor'''
|'''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.
|The GPU picks the color of the single closest pixel in the original texture.
|
|
*Very fast.  
* Preserves sharp pixel-art style.
*At integer values (eg, exactly double or quadruple resolution) it's practically "unfiltered".
* Lowest computational cost.
|
|
*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.
* Causes "shimmering" or "aliasing" in motion.
* 3D textures look "blocky" up close.
|-
|-
|'''Bilinear'''
|'''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.
|Averages the color data of the 4 closest pixels to create a smooth transition.
|
|
*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.
* Can look "blurry," especially on low-resolution textures.
*If you have the hardware to do so, look into more complex filtering methods to preserve clarity.
* Does not look good for 2D sprites.
|-
|-
|'''Trilinear'''
|'''Trilinear'''
|This linear filtering method does the same thing as bilinear filtering, but additionally interpolates between mipmaps (downscaled versions of the texture used for far away objects), thereby preventing mipmap banding (harsh transitions between mipmap levels).
|An extension of Bilinear that interpolates between mipmaps (different resolution versions of the same texture).
|
|
*Looks better than bilinear filtering for 3D games.
* Eliminates visible "lines" or "bands" between texture quality levels in the distance.
|
|
*As with bilinear, low-resolution games will more than likely appear overly blurry using this method.
* Still produces blurriness at sharp viewing angles.
|-
|'''Anisotropic (AF)'''
|Enhances texture quality on surfaces viewed at oblique angles (like floors or walls).
|
* Drastically improves clarity for distant textures.
* Modern GPUs handle this with almost zero performance loss.
|
* Not available on older legacy hardware.
|}
 
==Texture Scaling Algorithms==
{{for|smoothing shaders|Shaders, presets and filters#Smoothing}}
These are enhancement algorithms (often called "upscalers") used by emulators to increase the resolution of textures to look better on modern displays.
 
{| class="wikitable" style="text-align:center;"
! scope="col"|Scaling Algorithm
! scope="col"|What it does
! scope="col"|Pros
! scope="col"|Cons
|-
|-
|'''HQx'''
|'''HQx'''
Line 101: Line 121:
|
|
*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.
*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.
*Posterization is very common. There are deposterization filters in some emulators (e.g. PPSSPP) that can aid this, however.
*Posterization is very common. There are deposterization filters in some emulators (e.g. PPSSPP) that can aid this, however.
Line 147: Line 167:
*Looks pixelated, highlighting the low resolution.
*Looks pixelated, highlighting the low resolution.
*Textures scaled horizontally and vertically at unequal levels can produce awkward results. [https://old.reddit.com/r/finalfantasytactics/comments/10iqeph/i_spent_a_couple_of_hours_testing_ppsspps/ Resolution hacks] may be able to fix this in some instances.
*Textures scaled horizontally and vertically at unequal levels can produce awkward results. [https://old.reddit.com/r/finalfantasytactics/comments/10iqeph/i_spent_a_couple_of_hours_testing_ppsspps/ Resolution hacks] may be able to fix this in some instances.
|-
|'''NNEDI3'''
|A neural network-based "edge-directed" interpolator. It uses a pre-trained model to predict what missing pixels should look like based on existing edges and structures.
|
*Exceptional at preserving sharp edges without the "oil painting" look of xBRZ.
*Virtually eliminates jagged edges (aliasing) on 2D elements and UI.
*Considered one of the highest-quality "clean" upscalers available.
|
*Extremely hardware intensive compared to every other filter on this list; requires a capable GPU.
*Can sometimes introduce small "wobbles" or artifacts in very complex, noisy textures where the AI misidentifies an edge.
|-
|'''ArtCNN'''
|A lightweight Convolutional Neural Network (CNN) designed for real-time upscaling and artifact removal. It uses machine learning to reconstruct sharp edges and smooth gradients.
|
*Produces some of the cleanest results for 2D art and UI elements.
*Excellent at removing "ringing" and compression artifacts that other scalers might amplify.
*Provides a much more natural, "hand-drawn" look compared to the "oil painting" effect of xBRZ.
*Highly optimized; much faster than NNEDI3 while providing similar or better visual clarity.
|
*Requires a GPU that supports modern shader languages (Vulkan/GLSL/HLSL).
*Can occasionally "over-clean" textures, removing intentional film grain or fine grit in 3D textures.
*May be too demanding for very low-end integrated graphics or older mobile devices.
|}
|}


==Durante's Hybrid and Deposterization Filters for PPSSPP==
==Emulator Specific==
These are specific options found in emulators like [[PPSSPP]] that modify or combine the methods listed above to achieve better results. PPSSPP has a scaling option known as "Hybrid." There's also an option called "Deposterize." Posterization, meaning a sharp contrast in hue from one pixel to another (very common in low-quality gifs) has been a problem plaguing texture scaling algorithms for quite some time. Durante's filter switches between xBR and bilinear/bicubic filtering depending on the texture information. On top of this, the "Deposterize" option tackles posterization edges in compressed textures, allowing for a smooth gradient rather than a sharp transition. Although it's not perfect (a perfect scaler sadly isn't possible with today's computing power) it's still great and it's recommended to use for PPSSPP if you have the specs.


PPSSPP has a scaling option known as "Hybrid." There's also an option called "Deposterize." Posterization, meaning a sharp contrast in hue from one pixel to another (very common in low-quality gifs) has been a problem plaguing texture scaling algorithms for quite some time. Durante's filter switches between xBR and bilinear/bicubic filtering depending on the texture information. On top of this, the "Deposterize" option tackles posterization edges in compressed textures, allowing for a smooth gradient rather than a sharp transition. Although it's not perfect (a perfect scaler sadly isn't possible with today's computing power) it's still great and it's recommended to use for PPSSPP if you have the specs.
{| class="wikitable" style="text-align:center;"
! scope="col"|Feature
! scope="col"|What it does
! scope="col"|Pros
! scope="col"|Cons
|-
|'''Hybrid / Hybrid + Bicubic'''
|A scaling method that switches between xBR and bilinear/bicubic filtering depending on the texture information. It attempts to detect which parts of a texture need sharp edge enhancement and which are smooth gradients.
|
*The "best of both worlds": preserves sharp edges where needed while keeping smooth areas (like skies) from looking blocky or "posterized."
*Generally considered the "Gold Standard" for a balanced look in PPSSPP if the hardware can handle it.
|
*Highly system-intensive.
*While it aims for a perfect balance, a perfect scaler isn't possible with today's computing power, so some textures may still look slightly inconsistent.
|-
|'''Deposterize'''
|A filter that tackles "posterization" (sharp, ugly jumps in color hue common in compressed textures) by smoothing out the transitions into a natural gradient.
|
*Allows for a smooth gradient rather than a sharp, blocky transition in colors.
*Greatly reduces the "oil painting" artifacts that often plague other texture scaling algorithms.
*Highly recommended for use in PPSSPP if you have the specs to support it.
|
*Can occasionally "wash out" textures where sharp color transitions were an intentional part of the art style.
*Adds extra load to the GPU when combined with high-level scalers.
|}


==Images==
==Images==
Line 171: Line 238:
Super_Mario_All-Stars_with_5xBR.png|SNES game with 5xBR texture scaling
Super_Mario_All-Stars_with_5xBR.png|SNES game with 5xBR texture scaling
</gallery>
</gallery>
==Texture filtering hacks==
Some emulators features better texture filtering: enhancement option for providing better texture filtering methods comparing the original hardware had.
See;
*[[Wii emulators#Enhancements]]
*[[GameCube emulators#Enhancements]]
*[[Dreamcast emulators#Enhancements]]
*[[Nintendo 64 emulators#Enhancements]]
*[[PlayStation 2 emulators#Enhancements]]
*[[Xbox emulators#Enhancements]]
*[[Nintendo DS emulators#Enhancements]]
*[[PlayStation Portable emulators#Enhancements]]
sections.
==Framebuffer Scaling & Output Methods==
{{Main|Scaling}}


==Further reading==
==Further reading==
Line 177: Line 260:
* [https://casual-effects.com/research/McGuire2021PixelArt/index.html The original academic paper explaining the MMPX algorithm] (Warning: This is very dense and contains a great deal of jargon)
* [https://casual-effects.com/research/McGuire2021PixelArt/index.html The original academic paper explaining the MMPX algorithm] (Warning: This is very dense and contains a great deal of jargon)
* [https://dolphin-emu.org/blog/2025/06/04/dolphin-progress-report-release-2506/#2503-122-use-game-requested-anisotropic-filtering-by-pokechu22-and-billiard Use Game Requested Anisotropic Filtering - Dolphin blog 2025/06/04]
* [https://dolphin-emu.org/blog/2025/06/04/dolphin-progress-report-release-2506/#2503-122-use-game-requested-anisotropic-filtering-by-pokechu22-and-billiard Use Game Requested Anisotropic Filtering - Dolphin blog 2025/06/04]
* [https://github.com/hrydgard/ppsspp/pull/21527 PPSSPP PR: #21527 - NNEDI3 and Spline36 GPU texture scaling]


[[Category:FAQs]]
[[Category:FAQs]]