Scaling: Difference between revisions
m 8 revisions |
|||
| (14 intermediate revisions by 6 users not shown) | |||
| Line 1: | Line 1: | ||
{{stub}} | |||
[[File:Integer_scaling.png|thumb|250px|right|The original text at the top. Scaled text on the bottom. Showing improper scaling]] | [[File:Integer_scaling.png|thumb|250px|right|The original text at the top. Scaled text on the bottom. Showing improper scaling]] | ||
Scaling is a very important thing for emulation. | |||
==Nearest neighbour scaling== | |||
Nearest neighbour scaling scales the image without using any filters. When scaling up, this has the effect of duplicating making columns and rows of pixels at regular intervals. If the image is scaled to a multiple of the original resolution, this is called integer scaling. For instance, a 256x192 image scaled to 384x288 will double every other line of pixels. A 256x192 image scaled to 768x576 will have every line tripled. On the other hand, scaling the image down will skip lines, so a 256x192 image scaled to 128x96 will have every other line missing. | |||
==Integer scaling== | ==Integer scaling== | ||
Integer scaling is scaling by a factor of a whole number, so 2x, 3x, 4x, etc. In RetroArch, the option scales the image up to the greatest integer scale below the set resolution. So for instance, if you set your fullscreen resolution to 1920x1080 and enable integer scaling, it will only scale a 320x240 image up to 1280x960, and leave black borders all around. | Integer scaling is scaling by a factor of a whole number, so 2x, 3x, 4x, etc. In RetroArch, the option scales the image up to the greatest integer scale below the set resolution. So for instance, if you set your fullscreen resolution to 1920x1080 and enable integer scaling, it will only scale a 320x240 image up to 1280x960, and leave black borders all around. | ||
== | ==CRT monitor== | ||
Because not all systems use the same resolution, if you want them to be native resolution on your CRT Monitor you either have to make a different custom resolution for each game, or you can make one resolution that has a really high horizontal res, scale games to fit that resolution, and send that to your CRT which gets squished to 4:3. The latter is the better option since you don't have to change resolutions for every game you play, and bonus points if the horizontal res is an integer scale of several common console resolutions (3840 is a common multiple of 240, 256, and 384). | |||
==Scaling | ==Framebuffer and Output Scaling Shaders== | ||
{{Main|Shaders, presets and filters#Framebuffer and Output Scaling Shaders}} | |||
==Scaling | =Framebuffer Scaling & Output Methods= | ||
While [[Texture filtering|Texture Filtering]] happens inside the 3D engine and [[Shaders,_presets_and_filters#Smoothing Shaders|Smoothing Shaders]] are stylistic choices used to "redraw" the art, Framebuffer Scaling refers to the final step of displaying the game on your monitor.This is the process of taking the emulator's rendered frame (e.g., a 240p or 720p image) and stretching it to fit your 1080p or 4K host display screen. Unlike artistic shaders (like xBRZ), these methods aim for mathematical accuracy or shimmer reduction rather than changing the art style. While many of these methods are implemented via Post-Processing Shaders for better control, they are not always "shaders" in the traditional sense; they can be built-in functions of the emulator or the hardware's display scaler. | |||
*Shader-based Scaling: Uses the GPU to perform complex math (like Spline36 or Lanczos) to ensure the image stays sharp and artifact-free. | |||
*Driver/Hardware Scaling: The "basic" scaling performed by your GPU driver or monitor. Usually defaults to a simple Bilinear or Nearest Neighbor stretch, which can result in blur or "pixel shimmer" if not configured correctly. | |||
*Software-Level Scaling: Built-in options provided by emulators (e.g., PCSX2's "Sharp Bilinear" or "Smooth Bilinear" toggles). These are hardcoded into the emulator's video output code to provide a better result than the raw GPU driver without requiring the user to manually load external shader files. | |||
{| class="wikitable" style="text-align:center;" | |||
! scope="col"|Filtering type | |||
! scope="col"|What it does | |||
! scope="col"|Pros | |||
! scope="col"|Cons | |||
|- | |||
|'''Nearest neighbor''' | |||
|This scaling method assigns each output pixel the color of the single closest pixel in the original image (no averaging or blending). When enlarging an image, each source pixel is effectively “copied” into a block of identical pixels (e.g., 2× scaling turns 1 pixel into a 2×2 block). This preserves hard edges and a crisp, blocky appearance. | |||
| | |||
* Fastest and computationally cheapest (minimal GPU cost). | |||
* Preserves sharp pixel-art style with practically no blur or smoothing when using with integer scaling. | |||
| | |||
* If the output is not a perfect multiple (e.g., integer scaling 240p to 1080p), and instead using non-integer scaling: it causes uneven pixel sizes, leading to distortion, shimmer, or wobble artifacts during movement. | |||
* Text and fine details can look distorted or "warped" on modern displays if the scaling isn't perfectly aligned. | |||
* To avoid distortion, users often must use "Integer Scaling", which usually results in black bars on the top/bottom or sides of the screen on modern displays. | |||
|- | |||
|'''Bilinear''' (Smooth) | |||
|This spatial interpolation method samples the four nearest pixels surrounding a projected coordinate and calculates a weighted average of their values. By mathematically blending the data from the source framebuffer, it creates a smooth transition between samples, effectively eliminating the "staircase" effect (aliasing) seen in lower resolutions. This results in a continuous output signal that avoids the sharp, blocky transitions of nearest-neighbor upscaling. | |||
| | |||
*Looks better than nearest neighbor for 3D games. | |||
*Fast and computationally cheap form of scaling. | |||
| | |||
*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. | |||
|- | |||
|'''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. | |||
|} | |||
== | =Also see= | ||
*[[Resolution]] | |||
*[[Texture filtering|Texture scaling and texture filtering]] | |||
*[[Shaders, presets, and filters#Framebuffer and Output Scaling Shaders]] | |||
*[[Shaders, presets, and filters#DAR vs. PAR]] | |||
[[Category:FAQs]] | [[Category:FAQs]] | ||
Latest revision as of 10:58, 4 June 2026

Scaling is a very important thing for emulation.
Nearest neighbour scaling
[edit | edit source]Nearest neighbour scaling scales the image without using any filters. When scaling up, this has the effect of duplicating making columns and rows of pixels at regular intervals. If the image is scaled to a multiple of the original resolution, this is called integer scaling. For instance, a 256x192 image scaled to 384x288 will double every other line of pixels. A 256x192 image scaled to 768x576 will have every line tripled. On the other hand, scaling the image down will skip lines, so a 256x192 image scaled to 128x96 will have every other line missing.
Integer scaling
[edit | edit source]Integer scaling is scaling by a factor of a whole number, so 2x, 3x, 4x, etc. In RetroArch, the option scales the image up to the greatest integer scale below the set resolution. So for instance, if you set your fullscreen resolution to 1920x1080 and enable integer scaling, it will only scale a 320x240 image up to 1280x960, and leave black borders all around.
CRT monitor
[edit | edit source]Because not all systems use the same resolution, if you want them to be native resolution on your CRT Monitor you either have to make a different custom resolution for each game, or you can make one resolution that has a really high horizontal res, scale games to fit that resolution, and send that to your CRT which gets squished to 4:3. The latter is the better option since you don't have to change resolutions for every game you play, and bonus points if the horizontal res is an integer scale of several common console resolutions (3840 is a common multiple of 240, 256, and 384).
Framebuffer and Output Scaling Shaders
[edit | edit source]Framebuffer Scaling & Output Methods
[edit | edit source]While Texture Filtering happens inside the 3D engine and Smoothing Shaders are stylistic choices used to "redraw" the art, Framebuffer Scaling refers to the final step of displaying the game on your monitor.This is the process of taking the emulator's rendered frame (e.g., a 240p or 720p image) and stretching it to fit your 1080p or 4K host display screen. Unlike artistic shaders (like xBRZ), these methods aim for mathematical accuracy or shimmer reduction rather than changing the art style. While many of these methods are implemented via Post-Processing Shaders for better control, they are not always "shaders" in the traditional sense; they can be built-in functions of the emulator or the hardware's display scaler.
- Shader-based Scaling: Uses the GPU to perform complex math (like Spline36 or Lanczos) to ensure the image stays sharp and artifact-free.
- Driver/Hardware Scaling: The "basic" scaling performed by your GPU driver or monitor. Usually defaults to a simple Bilinear or Nearest Neighbor stretch, which can result in blur or "pixel shimmer" if not configured correctly.
- Software-Level Scaling: Built-in options provided by emulators (e.g., PCSX2's "Sharp Bilinear" or "Smooth Bilinear" toggles). These are hardcoded into the emulator's video output code to provide a better result than the raw GPU driver without requiring the user to manually load external shader files.
| Filtering type | What it does | Pros | Cons |
|---|---|---|---|
| Nearest neighbor | This scaling method assigns each output pixel the color of the single closest pixel in the original image (no averaging or blending). When enlarging an image, each source pixel is effectively “copied” into a block of identical pixels (e.g., 2× scaling turns 1 pixel into a 2×2 block). This preserves hard edges and a crisp, blocky appearance. |
|
|
| Bilinear (Smooth) | This spatial interpolation method samples the four nearest pixels surrounding a projected coordinate and calculates a weighted average of their values. By mathematically blending the data from the source framebuffer, it creates a smooth transition between samples, effectively eliminating the "staircase" effect (aliasing) seen in lower resolutions. This results in a continuous output signal that avoids the sharp, blocky transitions of nearest-neighbor upscaling. |
|
|
| Bilinear (Sharp) (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. |
|
|