All examples · Post-processing · As Markdown, for AIs

CRT screen

What this example shows

crt() puts the frame on a tube television. Each part is a number in effect.uniforms, and a part at 0 is not there at all: scanlines (the dark lines between rows), mask (the colour grid of the tube: aperture stripes, slot cells or dots, with maskType), curvature (the bulge of the glass), vignette (the corners going dark), halation (the glow of bright parts) and noise (moving grain). There are more: sharpness, beam (bright lines widen into the gap), brightness, linearBlend, convergence, flicker, interlace and cornerRadius.

POST_EFFECTS.CRT_PRESETS sets all of them as four tubes: consumer (the living-room television), pvm (a sharp studio monitor), arcade (a cabinet) and composite (a cheap cable). Use one whole with crt(POST_EFFECTS.CRT_PRESETS.pvm), or change one part of it with crt({ ...POST_EFFECTS.CRT_PRESETS.consumer, noise: 0 }).

One line per row of the game, not of the screen. The lines follow the game's own pixels, like a console's picture on the tube. This example uses pixelRatio: 'device': on a dense screen each game pixel is two or three real ones, and the line fits inside the row. On a screen of density 1 a row is a single pixel, so every other row is darkened instead, and the mask is best left off.

It goes last in the chain: the palette or the dither decide which colours exist, and the tube is only where they are shown. Press 1 to 6 to toggle each part, M to change the mask type, P to step through the presets and Space to switch it off.

Starting
Starting
—