Sep 15, 2026
Atmosphere and dread: a second shader research pass
Question: the first pass (Stylized shader looks) surveyed eight ways games build a look out of shaders. The direction chosen from it is closer to photoreal, but artsy and atmospheric, keeping the game's ominous, eerie theme, with the two horror families (imitating a camera or recording medium, and shaders tied to the mechanics) carrying the horror layer. What, concretely, do the games that achieve that look do, what do state-driven horror effects look like when they are done well, and which of it can Babylon.js 9.18 do at 60 fps in a browser?
Short answer: every photoreal-but-atmospheric game in the survey makes the same core move: a physically based sky and lighting underneath, an artist-controlled height fog on top of it, a neutral tone map followed by a grade, and a film treatment (halation, luminance-weighted grain, dither) so a dark, foggy image survives 8-bit output. The horror games that hold up over hours drive event rate and severity from their dread state and keep screen distortion as the smallest channel, confined to the edge of the frame. Almost all of it is cheap in Babylon: a handful of single-pass post-processes and per-material plugin terms. The three things Babylon does not give for free are a fog hook (the fog line has to be regex-replaced in the PBR fragment), an AgX or filmic tone map (a custom pass), and a volumetric headlamp cone (a cone mesh, not the built-in god-ray pass).
Every game links to its Steam page, or to its official site or Wikipedia where it is not on Steam. Sources are in the table at the end; anything marked unverified was reported second-hand and the primary source could not be opened.
The pre-restyle "style" was thinner than it looked. All of it was in client/src/game/:
lighting.ts: aSkyMaterialsky captured to a reflection probe for image-based ambient, a sun with cascaded shadows to 300 m, a hemispheric fill, ACES tone mapping with contrast 1.1, single-colour EXP2 fog to a 4 km horizon, and a nine-valueColorCurvessplit-tone grade (violet shadows, green-teal midtones, drained cyan highlights) scaled by the weather's mood.weather.ts: five presets (clear,overcast,mist,rain,eerie) as points in a continuous space with adreadaxis. Dread already pulls the fog toward a bruised green-grey, dips exposure, deepens the vignette and grain, and thickens the mist banks.clearis the machine-checked identity every modifier returns to.stylize.ts: a vignette on the shared image-processing config, aDefaultRenderingPipelinewith grain and radial chromatic aberration on medium and high, and the etched outline post-process (Roberts-cross edges on a depth pre-pass, normals on high, etch noise, dissolved by the fog);/style celswapped it forcel.ts, a material plugin that quantised direct diffuse into two bands. All retired by the restyle.skin.ts: wrap Lambert with a red terminator scatter on characters that carry a metallic-roughness texture.mistMeshes.ts: twelve unlit billboard banks coloured to the fog.headlamp.ts: oneSpotLightper player, 1.5 rad, intensity 400, no shadows.
The four material plugins (distanceFadePlugin, groundConformPlugin, windPlugin,
wingPlugin) and the ground blend in terrainTexture.ts are functional, not stylistic;
a restyle leaves them alone. Two facts carried into the restyle: the outline pass was the
only thing that expressed the "etched" identity, so the look was one post-process plus a
grade, which is why it did not read as distinct; and quality.ts declared an ssao flag
for the high tier that nothing in client/src consumed. The restyle retired the outline
pass, /style and the ssao flag.
The games
- Death Stranding: the clearest precedent. Decima combines a precomputed atmospheric-scattering model (photoreal, hard to art-direct) with an analytic height fog (artist-driven), "mixing both photorealism and artistic flexibility in a single model". Timefall rolls in as fog and turns the palette grey-green.
- Red Dead Redemption 2: sky, clouds and fog as one system tied to the time of day, "balancing physical accuracy with artistic control". Dawn mist, noon haze and dusk glow are one continuous curve, not presets.
- Ghost of Tsushima: "stylised realism" from a 128×64×64 froxel haze (~0.5 ms on async compute), hand-picked Rayleigh coefficients to get the right blue, a Bradford white point chosen per time of day, a Purkinje night shift (rods pull night scenes to blue-grey without a tint), and tens of thousands of airborne particles (pollen, leaves, ash) lit by the fog volume. Kurosawa mode is a calibrated monochrome with grain.
- Alan Wake 2: the most photoreal forest shipped and unmistakably graded, with lifted grey shadows, froxel fog with a multiple-scattering approximation "giving it a thick and realistic look", film grain as a player setting, HDR grading by professional colourists.
- Hunt: Showdown 1896: "every light affects the fog, and fog is also affected by shadows"; the workflow "mimics the workflow used for movies": a neutral HDR base image first, then a bold gold grade by day and a grim blue-black by night.
- Hellblade: Senua's Sacrifice and Senua's Saga: Hellblade II: photoreal scanned Iceland committed to a film presentation, with a 2.39:1 letterbox, soft filmic image, shallow depth of field, grain, chromatic aberration and motion blur as texture. The letterbox is also a resolution rebate: Hellblade II renders 1296–1440p and shows 962–1070 rows (unverified: reported from Digital Foundry's video, not the video itself).
- INSIDE: realistic lighting on minimal forms, fog in every shot, backlit silhouettes, and an image whose identity lives in the bottom tenth of the tone range. Playdead's GDC 2016 talk pairs it with "Banding in Games": triangular-PDF noise at about half an LSB, applied after the sRGB transform and before quantisation, animated per frame. That is what lets a dark, foggy, graded image hold in 8-bit.
- Everybody's Gone to the Rapture: a valley in permanent golden hour, built from stock CryEngine systems; the rules were "slow, languid movement" and one shape grammar shared by every light effect.
- Dear Esther: flat overcast light, fog that eats the horizon, silhouettes; identity through restraint.
- The Vanishing of Ethan Carter: the first indie game built from scans of real locations, which "deliberately avoided photorealistic presentation" by applying stylised lighting and post on top of the scanned geometry. The team used fog as a culling tool: the far clip plane sits where fog opacity reaches 100%.
- Mundaun: realistic lighting and fog acting on hand-pencilled textures. Proof that a photoreal pipeline with a non-photographic albedo reads as art without any post trickery.
- Bramble: The Mountain King: reportedly a bare rig of sky light, one directional light and an exponential height fog per level (unverified), which is the minimum that still makes a strong mood.
- Pacific Drive: the same Pacific Northwest forest family as Day Hike, "twisted from the familiar". A mood reference; no published post-process specifics.
- Still Wakes the Deep and Metro Exodus: fog and mist withhold the creature; identity from the contrast between areas.
Dropped after a look: Kholat, Sons of the Forest and Stray (no technique sources) and The Long Dark (painterly; belongs to the first pass).
The pattern
- Height fog with a sun-direction colour, instead of one fog colour. Iñigo Quílez's
closed-form height fog and a
mix(shadowColour, sunColour, pow(dot(view, sun), k))inscatter term give aerial perspective in a few lines: far ridges go blue-grey while the near mist stays warm. Bind density, height and both colours to the day-to-dusk clock and to the weather so they are curves, as in RDR2, rather than presets. - Neutral tone map, then a grade. Hunt's rule. ACES bends hue (the orange-and-teal drift); AgX attenuates chroma toward white as values rise and reads photographic. Tsushima's per-time-of-day white point and Purkinje matrix are the right way to make night blue-grey without tinting, and they flatter a warm headlamp.
- Film treatment. Halation (threshold, wide blur, red-orange tint, screen blend; not bloom) so the headlamp and the low sun read as lights on film; grain that is luminance-dependent and applied after tone mapping; triangular dither after sRGB so near-black fog does not band; optionally a letterbox.
- Airborne matter lit by the fog. Pollen at noon, midges at dusk, frost or ash at night, riding the wind field the foliage already sways to, coloured by the same inscatter term as the fog so motes glow in shafts and die in shadow.
- Silhouettes against the fog. INSIDE authors diffuse, specular and bounce separately so silhouettes can be pushed dark against lit mist; a forward PBR equivalent is a plugin term that scales ambient down near the fog horizon.
The games
- Alan Wake: enemies wear a shroud of darkness that the flashlight's focused beam burns off before they can be hurt; lamp posts are safe zones. The shroud is a legibility trick: an enemy is darker than dark until light touches it, and the burn-off is the state readout.
- Alan Wake 2: the overlap, a faded second view of a parallel location, is double-exposed over the playable scene as you near a threshold, and monochrome smash cuts arrive as the Dark Presence spreads. Enemies "never stop talking", with mumble loops tuned to their alertness, so you hear them before you see them.
- SILENT HILL 2 (2024): fog as the world's draw distance, a muted palette, and the flashlight as the dominant direct light with real bounce. The Otherworld flips at authored beats, "just as it seems like players have mastered their understanding of their surroundings", never on a timer.
- Amnesia: The Dark Descent: sanity drains in darkness and on sightings; the cue is a screen pulse plus a sound that gets "worse and worse", and discrete stings on events. Frictional removed every fail state from the meter because it could not be balanced across hours; the deterrence is entirely audio-visual. Low-sanity specifics (blur, warp, insects, delayed input) are unverified.
- Amnesia: Rebirth: fear accumulates in the dark; when it overwhelms, "grotesque images will also pop up in the screen": single-frame inserts and whisper layers gated by the scalar.
- Amnesia: The Bunker: when the lights flicker erratically, the creature is nearby. A light-intensity jitter as a proximity channel: cheap, diegetic, reads through walls.
- SOMA: nearing a creature, the screen distorts and glitches until the monster is "impossible to define visually". The warning hides the thing it warns about.
- Slender: The Arrival: camcorder static and chromatic aberration rise with proximity. Thomas Grip's verdict: a "great way to symbolize the presence of an evil being", but encounters "became increasingly frequent and the effect was lost". A proximity effect that fires often becomes a rule.
- Fatal Frame II: the camera's filament glows blue for a friendly spirit and red for a hostile one; ghosts fade in and out with distance. The indicator lives on the device, not the HUD.
- Phasmophobia: no hallucination post-process at all. Sanity drives the frequency of ghost events, flickering lights and hunts; the numbers come from a community guide (unverified).
- Visage: sanity drives the severity of each event rather than its rate.
- DREDGE: panic from staying out after dark makes rocks appear in the water, and they really damage the boat. The scalar changes the world, not the lens.
- Layers of Fear: the room changes when you look away, triggered by position or by view direction after light and sound have pulled attention elsewhere.
- Control: possessed hosts glow red "from inside", like "shining a bright torch beneath your hand"; one hue means one thing across the whole game.
- DEATH STRANDING: BTs are invisible until a scan sends a flash down the terrain and gives "a faint outline of any BTs on the horizon" for a moment. Two independent recreations show the scan is a post-process: quantised depth with a Sobel edge for the sweeping contours, converted to world-space distance so line spacing does not change with the camera.
- Pacific Drive: when enough energy is collected "the junction begins to destabilize, and the safe area shrinks", the closest published analogue to Day Hike's task-driven escalation.
- Dead by Daylight: a heartbeat in thirds of the terror radius (32 m default), with an accessibility option that draws the beating heart on the survivor's chest.
- Alien: Isolation: a menace gauge that "backs off and sends the alien elsewhere" at its peak, music remixed from live "stealth" and "threat" values, and view-cone scripting so the music never betrays an alien approaching from outside the field of view.
- Darkwood: outside the vision cone the scene is greyscale and enemies are not drawn at all.
- P.T.: one lighting change per loop (lit, then the radio, then lights out, then red). The lack of pattern is the point.
- S.T.A.L.K.E.R.: Shadow of Chernobyl: anomalies show as air distortion you can test with a thrown bolt, so the distortion is a warning localised to a world volume.
- Shorter: Outlast (seeing costs battery), Blair Witch (the dog barks when they are close; unverified beyond Wikipedia), The Medium (two full worlds rendered at once, a budget warning), SCP – Containment Breach (a forced blink as the entity's window), Lethal Company (deep shadow and fog so "the imagination takes hold").
Retroreflection has a recent primary source: the MRM paper (arXiv 2606.08739) makes any microfacet BSDF retroreflective by evaluating it with the view direction reflected about the normal, with no new parameters. It flares only for a small light near the eye, which is exactly a headlamp.
What it suggests for Day Hike's horror layer
The parent design already has an escalation scalar (task completion and leaving the trail), one persistent Hollow that must read from far away, a headlamp, retroreflective tape and a planned dread stack. The survey maps onto each:
- The scalar drives rate and severity, not amplitude. Whispers and misleading one-shots on a rate curve and a severity curve (Phasmophobia, Visage); the screen warp the smallest of the three channels (Grip's Slender lesson); Amnesia's split of a continuous, worsening cue plus discrete stings on task completion and on stepping off the trail. Alien's director rule: after a peak, back off.
- Lighting collapse as authored steps. Three or four discrete lighting states advanced on task milestones (P.T., Pacific Drive), with only small continuous drift inside each, rather than a slider.
- The Hollow is exempt from fog. Render it with fog factor zero and no distance desaturation so at 800 m it is still a pure black cut-out against fog that has gone grey-blue (an inference from Alan Wake's darker-than-dark shroud and Silent Hill's fog, not a documented technique). A thin rim against the fog colour keeps the outline at distance; inside the headlamp cone, Control's inner red translucency rather than a lit surface, so light passes through it and never reveals it. Death Stranding's one-shot depth-Sobel outline is the fallback if a guaranteed read is ever needed.
- Proximity cues must not leak position. Distance cues (lamp flicker, a heartbeat in bands) may scale continuously; directional cues only after the Hollow has been seen. SOMA's aberration is the model for the last 30 m, where the image itself hides it.
- The screen warp is AW2's overlap, at the periphery. A low-alpha ghost of a wrong view of the same trail, growing with the scalar, on the outer part of the frame, with no camera roll and a stable horizon, behind a 0–100% "unsettling effects" slider (Xbox Accessibility Guideline 117). The centre of the headlamp beam is always trustworthy.
- Retroreflective tape is a one-line material change, masked to the headlamp so moonlight never makes it glow.
Checked against the installed @babylonjs/core 9.18.0 source, not the docs alone.
| Technique | Mechanism | Cost | Notes |
|---|---|---|---|
| Vignette, exposure, contrast, colour curves, dithering | ImageProcessingConfiguration |
cheap | Already in use; every scalar is a plain uniform, safe to drive per frame |
| Grain, chromatic aberration, sharpen, FXAA | DefaultRenderingPipeline |
cheap | One pass each |
| Colour-grading 3D LUT | colorGradingTexture (.3dl or PNG) |
cheap | One 3D fetch in the image-processing pass |
| Tone mapping | TONEMAPPING_STANDARD / ACES / KHR_PBR_NEUTRAL |
cheap | No AgX or filmic mode exists; flipping the type recompiles, set it per tier |
| AgX tone map, halation, film grain, gate weave | one custom "grade" PostProcess |
cheap | three.js's AgX GLSL is MIT and ports directly; run it with the pipeline's image processing off, on linear HDR |
| Bloom | pipeline bloomEnabled |
moderate | Four passes at bloomScale |
| Depth of field | pipeline DoF | expensive | A depth re-render plus three to seven blur passes; dusk-only at best |
| Height fog with a gradient colour | PBR plugin regex on the expanded fog line | cheap | There is no fog hook in pbr.fragment.js; the PBR shader includes it as fogFragment(color,finalColor), so the expanded line is finalColor.rgb=mix(vFogColor,finalColor.rgb,fog); and a !-regex key must replace that. Version-fragile: pin with a compile test |
| Fog on the sky and particles | SkyMaterial colour by hand; applyFog stays single-colour |
cheap | The horizon has to meet the far end of the gradient |
| God rays from the sun | VolumetricLightScatteringPostProcess |
expensive | Re-renders every occluder; useless for an eye-mounted headlamp (the source is at the camera) |
| Headlamp volume | an additive cone mesh with depth-map soft intersection | cheap | The "good enough volumetrics for spotlights" technique; FrameGraphVolumetricLightingTask is frame-graph and directional-light only |
| UV warp, ripple, heat haze, overlap | custom PostProcess, one or two reads |
cheap | Fold every distortion into one pass driven by the scalar |
| Retroreflective tape, rim, fog silhouette | PBR plugin at CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR |
cheap | viewDirectionW is surface-to-camera; pass the lamp explicitly rather than reading light slots |
| Motion blur | MotionBlurPostProcess |
moderate to expensive | Needs the g-buffer or depth plus the previous view-projection |
LensRenderingPipeline |
separate chain | moderate | Conflicts with the default pipeline; take one custom pass instead |
Constraints that shape the design:
- Post-processes run in creation order and the pipeline's internal order is fixed (sharpen, DoF, bloom, image processing, chromatic aberration, grain, FXAA); the outline already runs first on linear HDR. Custom passes inside the chain must use the same half-float texture type or they truncate.
- One depth renderer per camera is shared by the outline, DoF and any new pass; a second scene render (g-buffer, god-ray occluders) costs several milliseconds in this forest. Budget the whole post chain at about 2 ms at 1440p and measure with paired samples.
- Plugin custom code is injected after include expansion and before
#ifdefevaluation;vAlbedoColoris the material constant; a directive spelled in a comment is parsed as real. All three traps are already recorded in the shader files. MaterialPluginBase.isCompatibleaccepts GLSL only, and adding an incompatible plugin throws, so on WebGPU a GLSL-only plugin breaks material creation unless the material forces GLSL. The restyle stays on WebGL2.
These are not decisions. They are the shapes the evidence supports.
- "Photographed dusk." Keep the PBR world; replace the identity layer with height
fog and sun-colour inscatter (a plugin), AgX plus a per-hour white point and a Purkinje
night matrix (one pass), a
.3dlLUT for the eerie grade, halation, luminance grain and dither. The etched outline and the cel band retire. This is the Death Stranding and Alan Wake 2 recipe at browser cost, and it keeps the world photoreal by construction. - Airborne matter as the signature. One particle system on the wind field, coloured by the fog term, changing species with the hour. Tsushima's identity, and the game's wind already exists.
- The horror layer as the two horror families. Lighting collapse in steps, the
overlap at the periphery, the fog-exempt Hollow with an inner glow, retroreflective
tape, lamp flicker by distance, and a filament-style diegetic indicator if the design
wants a detector. All of it on the existing
dreadaxis, which already reaches fog, exposure, vignette, grain and mist. - A letterbox as both a film cue and a resolution rebate, if the post chain needs the headroom.
| Source | Covers |
|---|---|
| Decima Engine: Advances in Lighting and AA (de Carpentier and Ishiyama, SIGGRAPH 2017) | The scattering-plus-height-fog hybrid |
| Creating the Atmospheric World of Red Dead Redemption 2 (Bauer, SIGGRAPH 2019; abstract only, slides unverified) | Integrated sky, cloud and fog |
| Real-Time Samurai Cinema (Patry, SIGGRAPH 2021) | Froxel haze, white point, Purkinje shift, particles lit by fog |
| How Northlight makes Alan Wake 2 shine (Remedy) | Multiple-scattering fog, grading, grain |
| The Development of Hunt: Showdown (80.lv) | Neutral base image, then a grade; lights in fog |
| Low Complexity, High Fidelity: The Rendering of INSIDE (Gjøl and Svendsen, GDC 2016) and Banding in Games | Dither after sRGB, silhouettes, authored light |
| Visual Revolution of The Vanishing of Ethan Carter (The Astronauts) | Stylised post on scanned geometry; fog as culling |
| Fog (Quílez) | Closed-form height fog and sun-direction colour |
| Khronos PBR Neutral and darktable's AgX | Tone-mapping choices |
| Alan Wake: Light and Dark (Lehtinen, GDC Europe 2010) | Darkness as a shield the light burns off |
| Game Design Deep Dive: Amnesia's Sanity Meter and Thoughts on Slender: The Arrival (Grip) | Continuous cue plus stings; why frequent proximity effects wear off |
| The Perfect Organism: The AI of Alien: Isolation and The sound of Alien: Isolation | Menace gauge that backs off; view-cone scripting |
| How the Beast works in Amnesia: The Bunker (AI and Games) | Light flicker as a proximity channel |
| Fog of Woe (Game Developer) | Silent Hill 2's fog and authored flips |
| Death Stranding Odradek terrain scanner, UE4 case study and the Unity recreation | The scan as a depth-Sobel post-process |
| MRM: microfacet retroreflection | Retroreflection by reflecting the view direction |
| Xbox Accessibility Guideline 117 and Game Accessibility Guidelines | Sliders for full-screen effects; stable horizon |
| Good enough volumetrics for spotlights (Chapman) | The headlamp cone mesh |
Babylon.js documentation: DefaultRenderingPipeline, Material plugins, Volumetric light scattering; installed source @babylonjs/core 9.18.0 |
Section 4 |