---
id: "ntsc-composite-vhs-crt-signal-emulation"
title: "Physically Modeled NTSC Composite / VHS Tape & CRT Electron-Beam Emulation"
aliases: [NTSC/VHS signal emulation, composite video shader, CRT electron-beam post-processing]
domain: "post"
stage: "post"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, cpu]
year_introduced: 2023
inputs: [ldr-image]
outputs: [ldr-image]
style: "stylized"
dynamic: "dynamic"
cost: "cheap"
authority: "ntsc-rs, 2023"
url: "https://texelatlas.vercel.app/t/ntsc-composite-vhs-crt-signal-emulation/"
sources_verified_at: "2026-11-30"
---
# Physically Modeled NTSC Composite / VHS Tape & CRT Electron-Beam Emulation (ntsc-rs, 2023)

> Simulates the full analog NTSC/VHS broadcast and tape pipeline—YIQ subcarrier modulation, bandwidth limiting, head-switching phase skew, and notch-filter demodulation—followed by a Gaussian CRT electron beam, phosphor mask, and halation.

## Reach for it when

- simple scanline overlay looks fake compared to a real crt television
- want authentic composite video chroma bleed rainbow artifacts and luma ringing
- emulate vhs tape tracking jitter head-switching noise and chroma lag
- simulate yiq subcarrier modulation and phosphor bloom in a post-process pass
- give retro 3d scenes genuine analog broadcast and home-video texture

## How it works

Naive retro shaders fake VHS by adding static scanlines and RGB channel offsets, missing the coupled artifacts of real analog video. Signal-accurate emulation instead operates at the native composite resolution (typically 240 active scanlines per field, sampled at 4× the NTSC color subcarrier frequency) in four physical stages.

First, the gamma-encoded picture converts to **YIQ** color space; the `I` and `Q` chroma channels are low-pass filtered, quadrature-modulated onto the color subcarrier, and summed with luma `Y` into a single 1D composite waveform per scanline. Tape snow, tracking jitter, and **head-switching horizontal skew** perturb that composite waveform directly—so shifting a line also shifts its subcarrier phase, naturally producing authentic hue warps. Next, an NTSC **notch or comb demodulator** separates luma and chroma; residual cross-talk creates real dot crawl and rainbow shimmering on sharp high-frequency edges. A **VHS tape pass** further band-limits luma (with edge-sharpening ringing) and heavily smears chroma horizontally and vertically.

Finally, a **CRT display stage** linearizes the decoded signal, rasterizes each scanline as a brightness-modulated Gaussian electron beam with RGB deconvergence, applies an aperture-grille or shadow-mask phosphor pattern, and adds low-resolution phosphor bloom and glass halation.

## When to use it

Choose it when you want genuinely authentic camcorder, VHS tape, or broadcast CRT imagery where rainbows, dot crawl, ringing, hue-shifted tracking errors, and blooming scanlines emerge from actual signal physics.

Prefer [film-emulation](film-emulation) when aiming for photochemical celluloid cinema rather than magnetic-tape television. Prefer [chromatic-aberration](chromatic-aberration) and [film-grain-synthesis](film-grain-synthesis) when you only want subtle optical lens defects without lowering spatial resolution. Prefer [pixel-art-3d-rendering](pixel-art-3d-rendering) when crisp low-res pixels should remain sharp rather than analog-blurred.

## Cost

cheap — The composite encode, decode, and VHS filter passes run at tiny signal resolution (around 760×240 or 910×240), making them very cheap on GPU; only the final CRT scanline, mask, and halation pass runs at full display resolution.
Measured GPU Weight: 8.22× baseline (moderate) — 0.2704 ms median / 0.2772 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 6.61× baseline (moderate) — 0.1051 ms median (2.57× faster on L4).
Ampere A100 scaling: 4.99× baseline (light) — 0.1437 ms median (1.88× faster on A100).

## Failure modes

- Moiré interference patterns when an aperture-grille or shadow-mask phosphor grid is rendered on low-DPI or non-integer-scaled displays
- Severe loss of UI text legibility due to authentic VHS chroma subsampling and 240p horizontal bandwidth limits
- Temporal flicker or excessive eye strain if interlaced field alternation and tracking jitter are left unattenuated
- Over-darkened output if phosphor mask attenuation is not balanced with brightness compensation and halation

## Dataflow

- Inputs: ldr-image
- Outputs: ldr-image
- Platforms: webgl2, webgpu, desktop-gpu, cpu

## Presets

### NTSC Composite / VHS & CRT Signal Emulation — clean digital RGB (left) vs YIQ subcarrier crosstalk, VHS skew & CRT phosphor beam (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_SUBCARRIER": 0.75,
  "P_VHS_WEAR": 0.55,
  "P_SCANLINES": 0.7,
  "P_SPLIT": 0.45
}
```

```glsl
const float P_SUBCARRIER = 0.75; // P YIQ Chroma Crawl [0.0, 1.2, 0.05]
const float P_VHS_WEAR = 0.55; // P VHS Tape Noise [0.0, 1.2, 0.05]
const float P_SCANLINES = 0.70; // P CRT Beam & Mask [0.0, 1.0, 0.05]
const float P_SPLIT = 0.45; // P Clean RGB / NTSC [0.0, 1.0, 0.02]

float hash11(float p) {
  p = fract(p * 0.1031);
  p *= p + 33.33;
  p *= p + p;
  return fract(p);
}

// Broadcast SMPTE test header + retro 1980s neon-horizon 3D chrome sphere scene
vec3 renderSource(vec2 uv, float t) {
  // Top SMPTE color bar strip (reveals YIQ chroma bleed & notch crosstalk unmistakably!)
  if (uv.y > 0.76) {
    float idx = floor(uv.x * 7.0);
    if (idx < 0.5) return vec3(0.85, 0.85, 0.85);
    if (idx < 1.5) return vec3(0.88, 0.84, 0.12);
    if (idx < 2.5) return vec3(0.12, 0.84, 0.86);
    if (idx < 3.5) return vec3(0.14, 0.82, 0.24);
    if (idx < 4.5) return vec3(0.86, 0.16, 0.84);
    if (idx < 5.5) return vec3(0.88, 0.14, 0.16);
    return vec3(0.14, 0.24, 0.88);
  }

  vec2 p = (uv - vec2(0.5, 0.38)) * vec2(1.5, 1.0);
  // Sunset sky + striped retro sun
  vec3 col = mix(vec3(0.10, 0.04, 0.22), vec3(0.56, 0.14, 0.44), smoothstep(0.32, -0.04, p.y));
  float sunD = length(p - vec2(0.0, 0.08));
  if (sunD < 0.22) {
    float cut = step(0.22, fract(p.y * 28.0 - t * 0.4)) + step(0.10, p.y);
    vec3 sunC = mix(vec3(1.0, 0.22, 0.38), vec3(1.0, 0.86, 0.24), smoothstep(-0.10, 0.26, p.y));
    col = mix(col, sunC, clamp(cut, 0.0, 1.0));
  }

  // Perspective synthwave grid floor
  if (p.y < -0.04) {
    float z = 0.26 / max(-p.y - 0.02, 0.015);
    float gx = abs(fract(p.x * z * 1.4) - 0.5);
    float gz = abs(fract(z * 1.1 - t * 1.2) - 0.5);
    float line = smoothstep(0.055, 0.015, min(gx, gz));
    col = mix(vec3(0.04, 0.02, 0.12), vec3(0.14, 0.92, 0.98), line * exp(-z * 0.11));
  }

  // Floating metallic chrome sphere in foreground
  vec2 sp = p - vec2(0.22 * sin(t * 0.7), -0.02 + 0.04 * cos(t * 1.1));
  float r = length(sp);
  if (r < 0.16) {
    float nz = sqrt(max(0.16 * 0.16 - r * r, 0.0));
    vec3 n = normalize(vec3(sp, nz));
    vec3 ref = reflect(vec3(0.0, 0.0, -1.0), n);
    vec3 env = (ref.y > 0.0)
      ? mix(vec3(0.95, 0.35, 0.55), vec3(0.18, 0.32, 0.76), ref.y)
      : mix(vec3(0.08, 0.04, 0.18), vec3(0.16, 0.92, 0.95), smoothstep(0.45, 0.5, abs(sin(ref.x * 16.0))));
    col = env + vec3(1.0, 0.96, 0.88) * pow(max(dot(ref, normalize(vec3(0.4, 0.6, 0.7))), 0.0), 24.0);
  }
  return col;
}

vec3 rgb2yiq(vec3 c) {
  return vec3(
    dot(c, vec3(0.299, 0.587, 0.114)),
    dot(c, vec3(0.596, -0.274, -0.322)),
    dot(c, vec3(0.211, -0.523, 0.312))
  );
}

vec3 yiq2rgb(vec3 yiq) {
  return vec3(
    yiq.x + 0.956 * yiq.y + 0.621 * yiq.z,
    yiq.x - 0.272 * yiq.y - 0.647 * yiq.z,
    yiq.x - 1.106 * yiq.y + 1.703 * yiq.z
  );
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = fragCoord / max(iResolution.xy, vec2(1.0));
  float split = clamp(P_SPLIT, 0.0, 1.0);
  float subAmp = clamp(P_SUBCARRIER, 0.0, 1.3);
  float wear = clamp(P_VHS_WEAR, 0.0, 1.3);
  float scan = clamp(P_SCANLINES, 0.0, 1.0);

  vec3 col = vec3(0.0);
  if (uv.x < split) {
    col = renderSource(uv, iTime);
  } else {
    // Subtle CRT glass barrel curvature
    vec2 cc = uv * 2.0 - 1.0;
    vec2 cuv = uv + cc * dot(cc, cc) * 0.032 * scan;

    // VHS head-switching skew at bottom 6% of frame + per-scanline jitter
    float lineId = floor(cuv.y * 240.0);
    float headSwitch = smoothstep(0.075, 0.015, cuv.y) * (0.018 * sin(cuv.y * 190.0 + iTime * 22.0) + 0.012);
    float lineJitter = (hash11(lineId + floor(iTime * 30.0) * 17.3) - 0.5) * 0.0045 * wear;
    cuv.x += headSwitch * wear + lineJitter;

    // Stage 1-3: Composite NTSC YIQ encoding -> narrowband chroma low-pass -> subcarrier crosstalk demodulation
    float yAcc = 0.0;
    float iAcc = 0.0;
    float qAcc = 0.0;
    float wY = 0.0;
    float wC = 0.0;
    float phase0 = cuv.x * 260.0 + lineId * 2.0944 + floor(iTime * 30.0) * 3.14159;

    for (int k = -3; k <= 3; k++) {
      float fk = float(k);
      vec2 suv = clamp(cuv + vec2(fk * 0.0026, 0.0), 0.001, 0.999);
      vec3 yiq = rgb2yiq(renderSource(suv, iTime));

      // Modulate composite signal s(t) = Y + I cos(wt) + Q sin(wt)
      float ph = phase0 + fk * 1.570796;
      float comp = yiq.x + (yiq.y * cos(ph) + yiq.z * sin(ph)) * subAmp;

      // High-freq luma leaks into chroma demodulator (dot crawl & rainbowing)
      float wy = exp(-fk * fk * 0.42);
      float wc = exp(-fk * fk * 0.14);
      yAcc += (yiq.x + (comp - yiq.x) * 0.16 * subAmp) * wy;
      iAcc += (yiq.y + (comp - yiq.x) * cos(ph) * 0.28 * subAmp) * wc;
      qAcc += (yiq.z + (comp - yiq.x) * sin(ph) * 0.28 * subAmp) * wc;
      wY += wy;
      wC += wc;
    }

    vec3 yiqOut = vec3(yAcc / wY, iAcc / wC, qAcc / wC);
    // VHS chroma delay & snow speckle on dropout lines
    float dropout = step(0.992 - wear * 0.012, hash11(lineId * 1.7 + floor(iTime * 18.0) * 3.1));
    yiqOut.x += dropout * (hash11(fragCoord.x + iTime * 90.0) - 0.2) * 0.45 * wear;
    col = clamp(yiq2rgb(yiqOut), 0.0, 1.4);

    // Stage 4: Gaussian CRT electron-beam scanline profile + RGB aperture-grille phosphor mask + halation
    float scanPhase = fract(cuv.y * 240.0) - 0.5;
    float beamWidth = mix(0.24, 0.42, clamp(yiqOut.x, 0.0, 1.0));
    float beam = exp(-(scanPhase * scanPhase) / max(beamWidth * beamWidth, 0.02));
    col *= mix(1.0, 0.42 + 0.85 * beam, scan);

    float pxMod = mod(floor(fragCoord.x), 3.0);
    vec3 grille = vec3(
      pxMod < 0.5 ? 1.16 : 0.84,
      (pxMod >= 0.5 && pxMod < 1.5) ? 1.16 : 0.84,
      pxMod >= 1.5 ? 1.16 : 0.84
    );
    col *= mix(vec3(1.0), grille, scan * 0.55);

    // Subtle glass phosphor bloom & vignette
    col += col * col * 0.18 * scan;
    float vig = 1.0 - dot(cc * 0.42, cc * 0.42) * scan;
    col *= clamp(vig, 0.45, 1.0);
  }

  float sep = smoothstep(0.0035, 0.0008, abs(uv.x - split));
  col = mix(col, vec3(0.95, 0.98, 1.0), sep);
  fragColor = vec4(clamp(col, 0.0, 1.0), 1.0);
}
```

Attribution: MIT — written for this index.

## Combines with

- [Multi-Bounce Acoustic Ray-Traced Echolocation Point-Cloud Visualization](https://texelatlas.vercel.app/t/acoustic-raytraced-echolocation-point-cloud.md): Transforms sparse luminous echolocation point clouds into found-footage camcorder video with authentic VHS bleed and CRT halation.
- [AgX](https://texelatlas.vercel.app/t/agx-tonemapping.md): Maps linear HDR scene light into display-referred gamma RGB prior to YIQ composite signal encoding.

## Combination ideas

- [Sonar echolocation point clouds on analog VHS-CRT](https://texelatlas.vercel.app/ideas/echolocation-pointcloud-ntsc-vhs-crt/)

## Sources

1. [primary] ntsc-rs (2023) ntsc-rs/ntsc-rs. https://github.com/ntsc-rs/ntsc-rs License: NOASSERTION. (verified via github on 2026-11-30)
2. [implementation] spite (2026) spite/codevember-2026. https://github.com/spite/codevember-2026 License: MIT. (verified via github on 2026-11-30)
3. [implementation] libretro (2016) libretro/slang-shaders. https://github.com/libretro/slang-shaders (verified via github on 2026-11-30)

## Cite this entry

Texel. "Physically Modeled NTSC Composite / VHS Tape & CRT Electron-Beam Emulation." https://texelatlas.vercel.app/t/ntsc-composite-vhs-crt-signal-emulation/ (accessed 2026-12-01).
