Difference between revisions of "CRT shaders"

From Emulation General Wiki
Jump to navigation Jump to search
(Added links to the main shaders repos, as well as some info on the shader types)
(oops)
Line 8: Line 8:
 
==Download==
 
==Download==
 
[https://github.com/libretro/slang-shaders/tree/master/crt slang shaders] - For use with devices that support Vulkan, OpenGL 3.x, GLES3, and/or D3D10/11/12. This is the most current, regularly maintained repository.
 
[https://github.com/libretro/slang-shaders/tree/master/crt slang shaders] - For use with devices that support Vulkan, OpenGL 3.x, GLES3, and/or D3D10/11/12. This is the most current, regularly maintained repository.
 +
 
[https://github.com/libretro/glsl-shaders/tree/master/crt GLSL shaders] - For use with devices that only support up to OpenGL 2.x or GLES2. Largely deprecated, though still sporadically maintained.
 
[https://github.com/libretro/glsl-shaders/tree/master/crt GLSL shaders] - For use with devices that only support up to OpenGL 2.x or GLES2. Largely deprecated, though still sporadically maintained.
 +
 
[https://github.com/libretro/common-shaders/tree/master/crt Cg shaders] - For use on platforms that only support Cg or HLSL runtimes, such as the PS3. Deprecated.
 
[https://github.com/libretro/common-shaders/tree/master/crt Cg shaders] - For use on platforms that only support Cg or HLSL runtimes, such as the PS3. Deprecated.
  

Revision as of 08:02, 10 July 2022

CRT-Geom-Flat, with default settings

CRT shaders are one of the most popular categories of shaders. While there had been many attempts to include some kind of CRT-esque filters in older emulators - usually involving little more than overlaying dark gray or black lines, colloquially referred to as scanlines, over the image - modern CRT shaders are much more complex and configurable.

Many of these replicate aperture grille CRTs (exemplified primarily by Sony TVs and monitors, though other manufacturers released their own versions of the technology later on), which have sharp images and strong scanlines. If you find that these shaders don't look a damn thing like your old TV, it's probably because you owned a slot mask-style CRT, which typically had less noticeable scanlines, or simply had a smaller set, which tended to be less sharp. The easiest way to tell the difference is to feel the curve of the screen; aperture grilles only curve horizontally if at all. Alternatively, look at the left and right sides of the glass against the frame - if the sides are curved, it's a slot mask; if they're straight, it's an aperture grille. Old TVs usually had slot masks, whereas monitors usually had shadow masks. While slot masks and shadow masks can be emulated to a certain degree even at 1080p, much higher resolutions like 4K or higher are better suited to the task. Aperture grilles are much easier to emulate, and can be satisfactorily replicated at 1080p, though it goes without saying even better results can be achieved with higher resolution.

It is advisable to use integer scaling when using CRT shaders. This means either using windowed mode (x2,x3,x4) or setting an integer scaling option in the video options. The reason is that non-integer scaled scanlines will result in uneven lines with artifacts, though some shaders use oversampling to try to avoid this. If the resulting letterboxing annoys you and you still want to fill up as much of your screen's real estate as possible, you can also try integer scale overscaling, which scales the image up by another integer to fill the vertical image space while still preserving integer scaling, at the expense of some of the image on the top and bottom being cut off. As an example, at 1080p, turning on overscaling would scale a typical SNES game running at 256x224 to 5x scale i.e. 1280x1120, cutting off twenty pixels from both the top and bottom of the image to reach 1080p. Before you fret, know that at 1080p and 4K the loss from overscaling is usually negligible and well within the area that would've been expected to be cut off on a real CRT anyway due to overscan, and developers almost always took this into account and made sure not to put any crucial game information there, so on many if not most older games, overscaling is completely safe.

Download

slang shaders - For use with devices that support Vulkan, OpenGL 3.x, GLES3, and/or D3D10/11/12. This is the most current, regularly maintained repository.

GLSL shaders - For use with devices that only support up to OpenGL 2.x or GLES2. Largely deprecated, though still sporadically maintained.

Cg shaders - For use on platforms that only support Cg or HLSL runtimes, such as the PS3. Deprecated.

Types

CRT-Geom

Main article: CRT Geom

Simulates an aperture grille display (with the dot mask enabled). Very versatile and modifiable. One of the first popular CRT shaders. Visit the main article for more details.

CRT-Calagari

An older CRT shader similar to CRT-Geom but uses different methods to achieve its effects.

CRT-Easymode

A flat CRT shader whose settings are easier to understand. Similar to CRT-Geom in its effects.

CRT-Hyllian

Aims only for picture quality, so it avoids things that degrade the image just for accuracy. It, however, uses far less power to run, so it is possible to run this shader on lower end systems than CRT-Geom.

Another version, crt-hyllian-lq.cg is specifically aimed at even lower end systems.

CRT-Lottes

A newer CRT shader that uses a horizontal shadow mask pattern with blooming. The horizontal pattern works quite well at current resolutions, though it isn't entirely accurate to a true vertical slot mask pattern.

GTU

A CRT shader that focuses more on simulating blur and blending effects and color levels of CRT screens rather than the physical attributes like phosphors and curvature. Highly configurable, can be really sharp, or really blurry or anywhere in between, with optional scanlines and contrast and gamma settings. Settings are stored in a separate "config.h" file for easy editing. GTU-Famicom is a variant that takes an image from an NES with "raw" colors and processes it to output an NTSC image much like an actual NES PPU.

The test program is a program that can adjust various attributes, such as horizontal and vertical blur, scanlines, etc. It is useful for testing settings to use with the shader, and also to understand how CRT shaders work in general.

CRT-Royale

Main article: CRT-Royale
CRT-Royale, with default settings at 1080p (view original for full details)

A highly advanced multi-pass CRT shader that simulates almost every aspect of the CRT screen. There are tons of parameters to configure, such as phosphor type (aperture grille, slot mask, and EDP shadow mask) and size (i.e. dot pitch), convergence offests, scanline blooming and many others. Higher resolution is better for this shader, especially with EDP shadow mask phosphor layout and with smaller phosphor dot pitch values. This shader is really complicated compared to most other CRT shaders, reading the README and the documentation in the user-settings.h is a must.

CRT-Royale-Kurozumi

A preconfigured CRT-Royale made to look like a professional CRT monitor, specifically Sony's PVM/BVM line of monitors.

Future

Shadow Mask Phosphor Emulation

Hypothetical shadow mask phosphor shaders such as PhosphorLUT and CRT-Royale are being developed. Due to the nature of the shadow mask screen, 4K resolution is likely needed to avoid significant downsampling of the phosphors.

External Links