Retro Pass Pipeline (r183-inspired)

CRT-style post-processing chain built with `EffectComposer`, combining scanlines, barrel curvature, chromatic separation, grain, and vignette.

Key topics: three.js retro pass, crt shader, scanlines, chromatic aberration, effect composer, r183

Overview

Old CRT monitors and televisions had a distinctive look: curved glass, visible scanlines, colour fringing, noise and dark corners. Recreating it is a popular way to give games and sites a retro feel. This demo builds a complete CRT-style pipeline as a single shader pass after the main render, combining curvature, scanlines, chromatic separation, grain and vignette, each with its own control.

How it works

The scene is rendered by a RenderPass and then processed by one custom ShaderPass. For each pixel the shader applies, in order:

  1. Curvature. The texture coordinate is pushed outwards with a barrel distortion based on its distance from the centre, bending the image as if it were on curved glass. Pixels that fall outside the screen after warping are painted black, which creates the rounded-rectangle frame.
  2. Scanlines. A high-frequency sine wave along the screen's vertical axis darkens alternate lines.
  3. Chroma separation. Red and blue are sampled slightly offset from green, imitating the imperfect convergence of a CRT's three electron beams. A small time-based drift that varies down the screen makes the fringes wobble like an unstable signal.
  4. Grain. Animated hash noise adds analogue static.
  5. Vignette. Brightness falls off towards the corners, like the uneven illumination of an old tube.

Doing all of this in one pass is cheaper than chaining five separate passes, because the image is read and written only once.

Exploring the demo

Turn every effect down to zero, then add them back one by one to see what each contributes. Small amounts of curvature and scanlines are usually enough to read as "retro"; push them all for an exaggerated arcade look.

Practical advice

Scanlines interact badly with the screen's own pixel grid at some sizes, causing moiré; scaling scanline density with the canvas height helps. Keep text readable by limiting curvature in UI-heavy scenes. Explore the individual effects in lens distortion, chromatic aberration, film grain and glitch, and see the retro shader style of the plasma demo.

What this code does

- PostFX Pipeline: `EffectComposer` routes the scene through a dedicated retro shader pass after the base render.
- CRT Curvature: barrel distortion bends screen edges to mimic old curved displays.
- Scanline + Grain Layer: animated scanline modulation and film grain add analog texture.
- Chroma Separation: subtle RGB channel offsets emulate lens/convergence artifacts.
- Vignette Framing: darkened corners focus the eye toward the center like vintage monitors.
- Interactive Controls: each effect component is adjustable to tune subtle or heavily stylized retro looks.

Continue Learning

JavaScript Implementation

ES6+
const composer = new EffectComposer(renderer)
composer.addPass(new RenderPass(scene, camera))
const retroPass = new ShaderPass(RetroShader)
composer.addPass(retroPass)

function animate () {
  requestAnimationFrame(animate)
  retroPass.uniforms.time.value += 0.016
  composer.render()
}
animate()

Related demos

Trending this week

Most popular