---
id: "chromatic-aberration"
title: "Chromatic aberration and vignette"
domain: "post"
stage: "post"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot]
year_introduced: 2010
inputs: [hdr-image, ldr-image]
outputs: [ldr-image]
style: "both"
dynamic: "both"
cost: "cheap"
authority: "Unity-Technologies, 2016"
url: "https://texelatlas.vercel.app/t/chromatic-aberration/"
sources_verified_at: "2026-11-29"
---
# Chromatic aberration and vignette (Unity-Technologies, 2016)

> Cheap lens-imperfection pass: sample red, green and blue at slightly different radial scales to fake lateral colour fringing, then darken toward the corners with a smooth radial falloff.

## Reach for it when

- image looks too clean and digital
- want colour fringing at screen edges like a real lens
- need cheap crt or cheap-lens look
- darken the corners to draw focus to the centre

## How it works

Lateral chromatic aberration is the wavelength-dependent magnification of a real lens. The shader computes the vector from the screen centre to the pixel, then reads the red channel at a slightly larger scale and the blue channel at a slightly smaller one, with green at the original position. The offset grows with distance from the centre, so the centre stays clean and fringes appear at edges. For smoother fringes, take several taps across the spectrum and weight them with a hue ramp. A vignette multiplies the result by a smooth function of the squared distance from centre, which can be aspect corrected and softened with a power or smoothstep. Both effects are applied late, in display space, after bloom and before grain.

## When to use it

Choose it for a subtle photographic or CRT feel, or to add edge-weighted attention.

Prefer a physically based lens flare or full lens simulation when accuracy matters. Apply before [Film grain synthesis](https://texelatlas.vercel.app/t/film-grain-synthesis.md) so the grain stays unaffected.

## Cost

cheap — One pass with three or a few more fetches.
Measured GPU Weight: 2.73× baseline (light) — 0.0897 ms median / 0.0923 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 2.19× baseline (light) — 0.0348 ms median (2.58× faster on L4).
Ampere A100 scaling: 1.87× baseline (feather) — 0.0538 ms median (1.67× faster on A100).

## Failure modes

- Too much looks like a cheap filter and softens fine UI or text
- Colour fringes on bright points exceed gamut after tonemapping if applied on HDR
- Aspect-ratio errors produce elliptical vignette
- Fringing becomes jaggy when the scene is not filtered or anti-aliased first

## Engine support

- babylonjs: builtin — `pipeline.chromaticAberrationEnabled = true; imageProcessing.vignetteEnabled = true` (evidence: https://github.com/BabylonJS/Babylon.js/blob/9.38.0/packages/dev/core/src/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.ts, checked 2026-12-01)
- blender: builtin — `Compositor > Add > Camera Lens Effects > Chromatic Aberration (and Vignette)` (evidence: https://docs.blender.org/manual/en/5.2/compositing/types/camera_lens_effects/chromatic_aberration.html, checked 2026-12-01) — Compositor nodes, applied after rendering.
- threejs: official — `import { chromaticAberration } from 'three/addons/tsl/display/ChromaticAberrationNode.js'` (evidence: https://github.com/mrdoob/three.js/blob/r187/examples/jsm/tsl/display/ChromaticAberrationNode.js, checked 2026-12-01)
- unity: builtin — `Volume > Add Override > Post-processing > Chromatic Aberration (and Vignette)` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Chromatic-Aberration.md, checked 2026-12-01) — URP and HDRP.
- unreal: builtin — `Post Process Volume > Lens > Chromatic Aberration > Intensity` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/post-process-effects-in-unreal-engine, checked 2026-12-01)

## Dataflow

- Inputs: hdr-image, ldr-image
- Outputs: ldr-image
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot

## Presets

### Radial fringing and vignette on a test pattern (glsl-fragment; rendered 2026-11-29)

```json
{
  "CA_STRENGTH": 0.03,
  "VIG_STRENGTH": 0.55
}
```

```glsl
// GLSL ES 3.0, Shadertoy-style
const float CA_STRENGTH = 0.03;
const float VIG_STRENGTH = 0.55;

vec3 scene(vec2 p) {
    vec2 g = floor(p * 4.0);
    float chk = mod(g.x + g.y, 2.0);
    vec3 col = mix(vec3(0.12, 0.14, 0.18), vec3(0.85, 0.82, 0.74), chk);
    float d = length(p - vec2(0.25 * sin(iTime), 0.0));
    col = mix(col, vec3(1.0, 0.25, 0.15), smoothstep(0.42, 0.40, d));
    float ring = abs(length(p) - 0.8);
    col = mix(col, vec3(0.1, 0.6, 1.0), smoothstep(0.03, 0.02, ring));
    col = mix(col, vec3(1.0), smoothstep(0.012, 0.008, abs(p.x)));
    return col;
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord / iResolution.xy;
    vec2 p = (uv - 0.5) * 2.0;
    p.x *= iResolution.x / iResolution.y;
    float r2 = dot(p, p);
    float k = CA_STRENGTH * r2;
    vec3 col;
    col.r = scene(p * (1.0 + k)).r;
    col.g = scene(p).g;
    col.b = scene(p * (1.0 - k)).b;
    vec2 q = uv - 0.5;
    float vig = 1.0 - VIG_STRENGTH * smoothstep(0.15, 0.75, dot(q, q) * 2.0);
    col *= vig;
    fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);
}

```

Attribution: written for this index

## Combines with

- [Film grain synthesis](https://texelatlas.vercel.app/t/film-grain-synthesis.md): The lens pass runs first and grain is layered on top at the end.

## Sources

1. [primary] Unity-Technologies (2016) Unity-Technologies/PostProcessing. https://github.com/Unity-Technologies/PostProcessing License: NOASSERTION. (verified via github on 2026-11-29)
2. [implementation] pmndrs (2015) pmndrs/postprocessing. https://github.com/pmndrs/postprocessing License: Zlib. (verified via github on 2026-11-29)
3. [implementation] mattdesl (2015) mattdesl/three-vignette-background. https://github.com/mattdesl/three-vignette-background License: MIT. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Chromatic aberration and vignette." https://texelatlas.vercel.app/t/chromatic-aberration/ (accessed 2026-12-01).
