Skip to content

Latest commit

 

History

History
72 lines (42 loc) · 6.65 KB

README.md

File metadata and controls

72 lines (42 loc) · 6.65 KB

Carlos' custom CRT shader presets for RetroArch

This repository contains a set of custom CRT shader presets for RetroArch based on its glsl-shaders. These presets are meant to look reasonable on resolutions slightly below 1080p and have good performance on weak graphics cards — I'm using them with an ATI Mobility Radeon HD 2600 from 2008 driving a 1680x1050 LCD screen.

  • crt-tv – subtle scanlines and a Sony Trinitron-like mask (aperture grille);
  • crt-tv-slotmask – same as crt-tv, but with a slot mask instead (most non-Sony TVs);
  • crt-tv-monitor – same as crt-tv-slotmask, but sharper;
  • crt-tv-slotmask-mixed – same as crt-tv-slotmask but approximating slower phosphor decay;
  • crt-scanlines – pronounced scanlines, with no discernible mask;
  • crt-mask-horizontal – pronounced scanlines and a bit blurry (like a worn CRT);
  • crt-mask-vertical – same as crt-mask-horizontal but for vertical (arcade) games;
  • crt-ega-newer – pronounced scanlines and subtle mask, mimicking EGA monitors;
  • crt-ega-older – same as crt-ega-newer but slightly more blurry;
  • crt-vga-newer – barely any scanlines and subtle mask;
  • crt-vga-older – same as crt-vga-newer but slightly more blurry;
  • crt-vga-alternate – similar to crt-vga-newer with added sharp-bilinear filtering.

I've found that crt-tv-slotmask or crt-tv works best for consoles, but I tend to prefer crt-scanlines for most arcade games. I know it's less accurate, because CRTs in arcade cabinets (like any color CRT) also had shadow masks, but fits better with my subjective memories somehow.

The crt-tv-slotmask-mixed preset is sometimes useful for demos with effects that depend on a CRT's phospor persistence to blend fast switching colors, like Mescaline Synesthesia for the ZX Spectrum.

The crt-ega-* presets are meant to be used with an MS-DOS emulator that can do single-scan (like DOSBox Pure), otherwise the scanlines won't be realistic at all. In VGA low-res graphics modes (e.g. 320x200) each row of pixels is drawn as two consecutive scanlines (double-scan), but not in EGA. In real EGA monitors the scanlines were very visible, while in VGA monitors they weren't.

Both the EGA and VGA presets approximate a slot mask which, truth be told, isn't very realistic upon close inspection but still provides reasonable texture from a distance. In reality, PC monitor shadow masks mostly used triads (circular dots in a triangular arrangement), but I haven't yet found a shader that simulates this and fulfills my performance and resolution requirements.

Composite Output

In the composite directory there are a couple more presets that may be useful when using an actual CRT fed by the composite video output of a Raspberry Pi. These (of course) don't attempt to simulate a CRT, they merely adjust the image slightly:

  • composite – sharp-bilinear filtering and gamma adjustment;
  • composite-mixed – sharp-bilinear filtering, approximating a slower phosphor.

You may be wondering why sharp-bilinear filtering is necessary, but consider that the emulated system isn't driving the CRT's electron beam directly, therefore the game's resolution probably doesn't match the Raspberry Pi's output resolution. For example, a Mega Drive game at 320x224 with the Pi outputting 720x480i. The sharp-bilinear filter makes the pixels uniformly sized while minimizing blur.

Also, you may wonder why it's necessary to approximate a slower phosphor. Again, because the emulated system isn't driving the CRT, it may be expecting a progressive scan output when the Pi is actually doing interlaced output. With interlacing the scanlines of successive frames don't blend together because the scanlines of the next frame are drawn in the empty space between the scanlines of the previous frame.

For these and other reasons, emulation on a Raspberry Pi with composite output to a CRT isn't an accurate reproduction of the orignal hardware. Though, in practice, it's often close enough.

Install

Clone this repository into a subdirectory of RetroArch's shader directory, like this:

cd /opt/retropie/configs/all/retroarch/shaders
git clone https://github.com/carlosefr/retroarch-shaders.git custom

The new presets will appear in RetroArch's Shaders / Load Preset menu under the custom folder. You can name it something other than "custom" if you prefer.

Examples

Click the following images to see them at their full 1680x1050 size:

In the Hunt and Puzzle Bobble for the arcade running in lr-fbneo with the crt-scanlines preset:

crt-scanlines  crt-scanlines

Zanac Neo for the PS1 running in lr-pcsx-rearmed, and Sonic the Hedgehog for the Mega Drive running in lr-genesis-plus-gx, with the crt-tv preset:

crt-tv  crt-tv

Aliens: Neoplasma II for the ZX Spectrum running in lr-fuse, and Super Mario Bros. for the NES running in lr-fceumm, with the crt-tv-slotmask preset:

crt-tv-slotmask  crt-tv-slotmask

Crystal Caves and Prince of Persia for MS-DOS, both running in lr-dosbox-pure with the crt-ega-newer and crt-vga-newer presets respectively:

crt-ega-newer  crt-vga-newer