AmbientOcclusion
The dark in the corners.
A shadow map tells you where the sun cannot reach. Ambient occlusion tells you where the sky cannot reach: under a ledge, in the crease where a wall meets the floor, between two crates. It is a small effect and it is the one that makes a hundred separate kit pieces read as one built thing, because every join gets the soft dark line a real join has.
The engine work lives in an adapter plugin that ships inside
@babylonjsmarket/arcade. A project made with bjs create already installs
it: registerArcadePlugins(adapter) in src/main.ts covers every built-in
plugin. If you boot the game from your own code, make the same call:
Without it the component is inert.
Knobs
| Field | Default | What it does |
|---|---|---|
active | true | Master switch. |
radius | 1.5 | How far, in world units, a surface looks for things that occlude it. Match it to the scale of your joins: a cell-sized kit wants one or two units. |
strength | 1.0 | How dark it gets. |
base | 0.1 | Floor of the darkening. Raise it if corners go black. |
samples | 16 | Depth samples per pixel. 8 is fast and grainy, 32 is smooth. Rebuilds the pipeline. |
maxZ | 120 | Beyond this distance the effect fades, so the far town does not go muddy. |
minZAspect | 0.2 | Keeps the radius from shrinking to nothing at distance. |
expensiveBlur | true | Edge-aware blur. Slower, no halos. |
ratio | 0.5 | Occlusion pass at half the frame's resolution. Rebuilds the pipeline. |
Every field is live.
Pairs with
An EnvironmentTexture: occlusion darkens the ambient light, and there has to
be ambient light to darken. ToneMapping keeps the result from crushing.

























