Texture filtering: Difference between revisions

Ahayri (talk | contribs)
Ahayri (talk | contribs)
 
(5 intermediate revisions by the same user not shown)
Line 63: Line 63:


==Texture Filtering Algorithms==
==Texture Filtering Algorithms==
These methods determine how a texture is sampled and displayed on a 3D model. They are generally native to original hardware or very common in all 3D emulators.
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/integer scaling (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''' (Smooth)
|'''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.
|-
|'''Bilinear''' (Sharp)<br />(Bilinear with Prescale)
|A technique that first scales the image using Nearest Neighbor to the largest possible integer size, then uses Bilinear filtering for the final "small" stretch to fill the screen.
|
*Eliminated "pixel shimmer" or "wobble" during scrolling.
*Keeps pixels looking sharp and square while filling the entire screen (even at non-integer scales).
|
*Requires a shader or specific support from emulator (like RetroArch or PCSX2).
*Technically a tiny bit of blur on the very edges of pixels compared to pure Nearest Neighbor.
|-
|-
|'''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.
|-
|-
|'''Spline36'''
|'''Anisotropic (AF)'''
|A high-order mathematical interpolation method. Unlike Bilinear, which only looks at the immediate surrounding pixels, Spline36 uses a larger 6x6 grid of pixels to calculate new color values.
|Enhances texture quality on surfaces viewed at oblique angles (like floors or walls).
|
|
*Sharper and more accurate than Bilinear/Trilinear.
* Drastically improves clarity for distant textures.
*Reduces "aliasing" (stair-stepping) on textures compared to simpler filters.
* Modern GPUs handle this with almost zero performance loss.
*Very computationally efficient on modern hardware.
|
|
*Can occasionally produce "ringing" artifacts (faint halos around high-contrast edges).
* Not available on older legacy hardware.
*While sharper than Bilinear, it still looks like a "blurrier" upscale compared to dedicated pixel scalers like xBRZ.
|}
|}


==Texture Scaling Algorithms==
==Texture Scaling Algorithms==
{{for|smoothing shaders|Shaders, presets and filters#Smoothing Shaders}}
{{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.
These are enhancement algorithms (often called "upscalers") used by emulators to increase the resolution of textures to look better on modern displays.


Line 187: Line 177:
*Extremely hardware intensive compared to every other filter on this list; requires a capable GPU.
*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.
*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.
|}
|}


Line 249: Line 251:
*[[PlayStation Portable emulators#Enhancements]]
*[[PlayStation Portable emulators#Enhancements]]
sections.
sections.
==Framebuffer Scaling & Output Methods==
{{Main|Scaling}}


==Further reading==
==Further reading==