BeamNG combines several techniques to represent direct shadows and indirect-light occlusion. Shadow maps provide the main direct-light shadows, SDSM distributes sun-shadow resolution, and PCSS, screen-space shadows, and GTAO+ address different details that shadow maps alone cannot reproduce efficiently.
These techniques complement one another:
| Technique | Affects | Uses | Main purpose |
|---|---|---|---|
| Shadow maps | Direct sun and local lights | Scene rendered from the light | Main direct-light visibility |
| SDSM | Sun shadow-map cascades | Visible camera depth | Concentrate cascade resolution around visible geometry |
| PCSS | Shadow-map filtering | Shadow maps and blocker depth | Contact-hardening penumbra |
| Screen-space shadows | Direct sunlight | Visible camera depth | Fine contact and distant shadow detail |
| GTAO+ | Ambient diffuse and environment reflections | Visible depth and surface normals | Indirect-light occlusion |
Shadow maps render scene depth from a light’s point of view. During lighting, the engine compares each surface with that depth to determine whether the light can reach it.
The sun uses cascaded shadow maps to cover a large distance around the camera. Local lights use their own shadow maps or a shared shadow atlas. These maps provide stable large-scale shadows from geometry both inside and outside the current camera view.
Shadow maps have finite resolution. Increasing Shadow Quality improves their texture resolution, but small or distant details can still occupy too few texels to produce a clear shadow. Filtering is also needed to soften their otherwise hard, aliased edges.
The sun uses Sample Distribution Shadow Maps (SDSM) together with its cascaded shadow maps. SDSM measures the range of visible camera depth and fits the four sun-shadow cascades around the part of the scene that is currently visible. This concentrates the available shadow-map resolution where it is useful instead of spending it on large empty depth ranges.
SDSM adjusts cascade placement, not shadow-map resolution or maximum shadow distance. Its depth range is updated gradually to avoid visible resolution jumps during camera movement. It runs automatically whenever sun cascaded shadows are active and does not have a separate graphics setting.
Percentage-Closer Soft Shadows (PCSS) filters shadow maps using the distance between the shadow caster and receiving surface. It first searches for blocking geometry, then widens the filter as the separation from that blocker increases.
The result follows the behavior of an area light:
Ultra Lighting Quality enables PCSS penumbra for sun shadows. Clustered local lights also use contact-hardening filtering when their shadow softness is greater than zero on the main Advanced Lighting 1.5 path.
Screen-space shadows add fine direct-sun shadowing by tracing through the scene depth visible to the camera. Their result is combined with the sun shadow-map result, so they can only add missing shadow detail rather than remove existing shadows.
This is useful for:
Screen-space shadows do not replace shadow maps or PCSS. Shadow maps provide the main large-scale result, PCSS controls its penumbra, and screen-space shadows add view-dependent detail.
Because the technique only knows about the current camera depth, geometry outside the view or hidden behind the nearest visible surface cannot cast these shadows. Detail can disappear near screen edges or as an occluder leaves the frame. The effect is therefore faded near the edges and should not be required for essential scene readability.
Screen-space shadows are enabled by the Normal, High, and Ultra overall graphics presets when supported. They are disabled by the Low and Lowest presets and when shadows are disabled.
Screen-space ambient occlusion (SSAO) estimates how much indirect environment light is blocked by nearby geometry. BeamNG uses a customized Ground Truth Ambient Occlusion implementation called GTAO+.
GTAO+ reads the visible scene depth and surface normals, searches around each pixel for geometry that blocks its surrounding hemisphere, and produces a visibility mask. This mask reduces ambient diffuse lighting and environment reflections, including ambient light produced by the sky. It adds depth to corners, contact areas, undersides, wheel wells, and other places that would otherwise receive too much indirect light.
BeamNG’s implementation extends XeGTAO with bitmask-based horizon sampling. It calculates occlusion at half resolution, then uses motion data and previous frames to reconstruct a stable full-resolution result. A depth- and normal-aware filter smooths the result while preserving edges. Higher Ambient Occlusion Quality uses more detailed sampling for cleaner contact shading.
GTAO+ does not create light, affect direct sun or local lights, or replace their shadows. Like other screen-space techniques, it cannot detect geometry outside the view or hidden behind the nearest visible surface. Its result can change near screen edges, around thin geometry, during fast motion, or when previously hidden surfaces become visible.
Material ambient-occlusion maps remain useful for small baked details that GTAO+ cannot detect. Material AO and the GTAO+ visibility mask are combined during shading.
No single technique covers every lighting case at a practical cost:
PCSS and screen-space shadows affect direct-light shadows. GTAO+ affects indirect ambient lighting and reflections. A dark GTAO+ crease is therefore not a substitute for a sun or local-light shadow.
Was this article helpful?