Lighting Techniques



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

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.

SDSM cascade distribution

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.

PCSS contact-hardening shadows

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:

  • Shadows remain relatively sharp where an object touches a surface.
  • The penumbra becomes wider and softer farther from the caster.
  • The shadow-map resolution and represented geometry do not change.

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.

PCSS Off

PCSS On

Penumbra softness is not the same as low shadow resolution. Low resolution creates blocky or unstable edges. PCSS intentionally changes edge softness according to caster distance.

Screen-space shadows

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:

  • Contact shadows from small visible geometry.
  • Thin details that occupy too little space in a sun shadow cascade.
  • Distant visible geometry whose shadow-map representation is limited.

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.

Landscape — Screen-Space Shadows Off

Landscape — Screen-Space Shadows On

Interior — Screen-Space Shadows Off

Interior — Screen-Space Shadows On

GTAO+ ambient occlusion

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.

Clear weather - GTAO+ Off

Clear weather - GTAO+ On

Overcast - GTAO+ Off

Overcast - GTAO+ On

Why all above techniques are needed

No single technique covers every lighting case at a practical cost:

  1. Shadow maps establish whether direct light reaches a surface.
  2. SDSM concentrates sun-shadow cascade resolution around visible geometry.
  3. PCSS gives those mapped shadows realistic distance-dependent softness.
  4. Screen-space shadows recover fine visible sun-shadow detail.
  5. GTAO+ reduces indirect environment light where nearby geometry blocks it.

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.

Best practices

  • Author the scene around shadow maps and correct physical lighting first.
  • Use Shadow Quality to evaluate shadow-map resolution.
  • Use Ultra Lighting Quality to evaluate sun PCSS penumbra.
  • Check Normal and lower presets without relying on screen-space detail.
  • Use material AO maps for small baked occlusion that screen-space depth cannot represent.

Related pages

Further reading

  • XeGTAO - Intel’s open-source reference implementation of Ground Truth Ambient Occlusion and the foundation of BeamNG’s GTAO+ path.
  • Screen space indirect lighting with visibility bitmask - research introducing the visibility-bitmask representation used by BeamNG’s horizon-based ambient occlusion sampling.
  • Inside Bend: Screen Space Shadows - Bend Studio’s technical overview, presentation, and reference code for the screen-space shadow technique used by BeamNG.
  • Sample Distribution Shadow Maps - the original SDSM paper, describing how visible depth samples can automatically optimize shadow-cascade placement.
  • Percentage-Closer Soft Shadows - NVIDIA’s original PCSS paper, covering blocker search, penumbra estimation, and distance-dependent shadow filtering.
Last modified: July 23, 2026

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.