Skip to content

gizmo98/gizmo-crt-shader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gizmo-crt-shader

This libretro shader tries to mimic crt behaviour without extensive use of scanlines and replicating CRT pixel patterns.

Assumptions for shader development

  • CRT output is much more vivid compared to a LCD. There a small deviations in color and position. A CRT always seems to restless.
  • A CRT has no fixed resolution. Fractional scaling is no problem.
  • If you take a look at CRT vs LCD comparisons it's obvious that phosphor not only changes color from black to red/green/blue. The spatial extent also changes. Scanlines are good visible in dark regions but they are almost invisible in bright regions.

Implementation

  • A small portion of static noise was added to make the output a little bit restless
  • To allow fractional scaling, horizontal subpixel scaling for LCDs with RGB patterns was implemented. To get smooth vertical scaling "improved bilinear interpolation" from Inigo Quilez was implemented.
  • A scanline or "pixel separation" function was implemented which takes the brightness of the current pixel into account and produces a thicker or thinner "scanline".

Examples

Subpixel scaling

subpixel scaling

Scanlines

scanlines 240p test suite - 2 Scanlines

Horizontal Blur

colour bleeding

Variants

gizmo-crt.glslp

Default v0.3 variant.

gizmo-crt-n64.glslp

Default v0.3 variant with vertical and horizontal blur for n64.

gizmo-crt-megadrive.glslp

Default v0.3 variant with horizontal blur and 4:3 aspect for megadrive.

gizmo-crt-snes.glslp

Default v0.3 variant with 4:3 aspect for snes.

Results

240p test suite - 1 starfox - 1 SOM-gizmo-crt-rgb_2 sonic (1) M64-native_res_factor_1-3

Comparison

gizmo-crt

240p test suite - crt-rgb

CRT-Royal

p240 test suite CRT royale

CRT-PI

p240 CRT-PI

Nearest neighbor vs shader comparison

p240 comparison org p240 comparison

gizmo-crt-n64-curvator vs bilinear vs nearest neighbor

crt-n64 vs bilinear vs nearest neighbor

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages