Outlines

reviewedstylisedtoonpost-processselectionhighlightx-ray

A line around an object's silhouette (and sometimes its inner edges). Used for toon/cel styles, and for gameplay: selection, interactables, x-ray through walls.

Two families: geometry (draw extra geometry per object) and screen-space (find edges in buffers after rendering). Style outlines want per-object control and inner lines; gameplay highlights want a clean, constant-width silhouette on anything.

Toon baseline: thick jump-flood ink silhouette with thin, softer edge-detected inner lines on a robot, box and knotfull screen ↗ Baseline: a thick jump-flood silhouette (5 px, ink) over thin edge-detected inner lines (1 px, softer ink). The contrast between the two weights is what reads as "drawn".

At a glance

Technique Looks like Cost Best for
Inverted hull Thick, per-object line, can vary width low Toon characters
Edge detection Lines on every depth/normal/colour break low–med Whole-scene ink/sketch styles
Mask dilation Soft or hard glow around a selected object low–med Thin selection highlights
Jump flood Crisp, constant-width, any width med Toon silhouettes, gameplay highlights
Occluded parts (x-ray) Outline or hatched fill behind walls low Allies, objectives, interactables
Fresnel rim Glowing edge inside the silhouette very low Cheap "hit"/"selected" glow
Authored lines Hand-drawn inner lines that don't swim authoring Anime / fighting-game look

Inverted hull

Inverted hull: note the gaps at the box corners and on the robot's hard edgesfull screen ↗

6x zoom on the box corner: the hull splits into separate slabs and leaves a gapfull screen ↗ Zoomed 6×: with split (hard) normals each face's shell moves out on its own and the corner opens. Without smoothed normals the hull splits at hard edges (box corners, robot panels).

Edge detection (post-process)

Edge detection: thin ink lines on silhouettes, creases and material boundariesfull screen ↗

What each buffer and term contributes:

Normals Material IDs
View-space normal bufferfull screen ↗ Material ID buffer, one colour per materialfull screen ↗
Depth term: silhouettes, not floors Normal term: creases
Depth term: object silhouettes only; the floor stays cleanfull screen ↗ Normal term: box crease and robot panel edgesfull screen ↗
ID term: material boundaries Close-up (5×): 1–2 px lines
ID term: boundaries between materials, including the box on the floorfull screen ↗ 5x zoom on the robot's arm: crisp one to two pixel linesfull screen ↗

Where the naive depth test fails: a low camera looking along the floor.

Naive depth difference Inverse-depth Laplacian
False black band where the floor meets the horizonfull screen ↗ Same view, no false bandfull screen ↗

Mask dilation (blur / kernel)

Hard (max over disc) Glow (Gaussian, additive)
Hard mask dilation, 3 pxfull screen ↗ Soft mask dilation glow, 8 pxfull screen ↗

8x zoom: the hard dilated band has stair-stepped edgesfull screen ↗ Zoomed 8×: a max-over-disc band is binary, so its edge is stair-stepped (compare jump flood below).

Jump flood (distance field)

6 px band + ink edge 20 px, one extra pass
Jump-flood highlight: cream band with ink edge, visible parts onlyfull screen ↗ Jump-flood outline 20 px widefull screen ↗

8x zoom: the band's outer edge is smooth, its inner edge follows the jagged object maskfull screen ↗ Zoomed 8×: the outer edge is anti-aliased from the distance value; the inner edge follows the aliased mask (render the mask with MSAA or supersampling if that matters).

Occluded parts (x-ray)

Not an outline technique itself, but a layer that works with any mask-based one (jump flood, dilation).

Hide Outline Ghost
Only the visible part is outlined; legs behind the wall get nothingfull screen ↗ Whole silhouette outlined, drawn over the wallfull screen ↗ Hidden legs filled with a blue hatched tintfull screen ↗

Fresnel rim

Fresnel rim: edges glow on the knot and robot, but the box's flat faces get almost nothingfull screen ↗

Authored lines

In game design

Outlines do two different jobs, and most games use several kinds at once, each with its own rules:

Layer Purpose Typical look When it's on
Line art (art style) Readability and style: shapes read clearly, the world looks drawn Dark ink silhouette + thinner inner lines, on everything Always; part of the look, like lighting
Focus / interactable "You can use this" / "this is what you're aiming at" Bright, wider band (jump flood), often animated in Only on the current target, or on usable objects within range
X-ray / ghost Keep something important trackable behind walls Outline-through or tinted hatch fill Only for a few things that matter now: the held/interacted object, the objective, teammates
State feedback Hit, damage, pick-up, cooldown ready Fresnel rim flash, colour pulse For a moment, on the affected object

Baseline

References