RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Client CanvasCaustics PostFXChromatic Lens PostFXClient CoreDepth of Field PostFXEdge AA PostFXPostFx Flash EffectPostFx Fog EffectsPostFx FXAA Anti-AliasingGamma PostFXPostFx Glow EffectShadow Maps InitClient LightingPostFx Light Ray EffectAdvanced Lighting - Light VisualizationPostFx Masked Screen BlurMotion Blur PostFXObjects Required for StartupClient Parse ArgsClient PostFX ManagerRender ManagerAdvanced Lighting - ShadersBasic Lighting - Shadow FilterAdvanced Lighting - Shadow VisualizationPostFx SMAA Anti-AliasingPostFx SSAO (Screen-Space Ambient Occlusion)PostFx Turbulence EffectPostFx Utilities

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE ExtensionsClient

PostFx SSAO (Screen-Space Ambient Occlusion)

Dual-radius screen-space ambient occlusion effect. Provides small-radius detail occlusion and large-radius contact shadows with configurable quality levels.

Dual-radius screen-space ambient occlusion effect. Provides small-radius detail occlusion and large-radius contact shadows with configurable quality levels.


Overview

Declarative setup script (no M module). Registers:

  • SSAOPostFx - Main SSAO PostEffect (PostEffectSSAO class)
  • SSAOVizPostFx - Debug visualization of the SSAO mask
  • SSAOPowTableShader / SSAOPowTablePostFx - Power table lookup texture
  • SSAOPostFxCallbacks - Enables/disables AL SSAO mask, manages quality and shader constants

Scene Objects

ObjectTypeDescription
SSAOPostFxPostEffectSSAOMain SSAO compute pass
SSAOVizPostFxPostEffectSSAODebug: renders #ssaoMask to back buffer
SSAOPowTablePostFxPostEffectGenerates #ssao_pow_table (256×1, R16F, on-demand)

Global Callbacks

GlobalCallbackDescription
SSAOPostFxCallbacksonEnabled()Sets $AL::UseSSAOMask = true
SSAOPostFxCallbacksonDisabled()Sets $AL::UseSSAOMask = false
SSAOPostFxCallbacksonAdd()Initializes tracking state
SSAOPostFxCallbackspreProcess()Updates quality macro (0/1/2) and target scale
SSAOPostFxCallbackssetShaderConsts()Pushes all SSAO parameters to shader uniforms

Console Variables

Global

VariableDefaultDescription
$SSAOPostFx::overallStrength2.0Master intensity multiplier
$SSAOPostFx::quality0Quality level (0, 1, or 2)
$SSAOPostFx::targetScale"0.5 0.5"Render target resolution scale
$SSAOPostFx::blurDepthTol0.001Blur depth tolerance
$SSAOPostFx::blurNormalTol0.95Blur normal tolerance

Small Radius (s-prefix)

VariableDefaultDescription
$SSAOPostFx::sRadius0.1Sample radius
$SSAOPostFx::sStrength6.0Occlusion strength
$SSAOPostFx::sDepthMin0.1Minimum depth
$SSAOPostFx::sDepthMax1.0Maximum depth
$SSAOPostFx::sDepthPow1.0Depth power curve
$SSAOPostFx::sNormalTol0.0Normal tolerance
$SSAOPostFx::sNormalPow1.0Normal power curve

Large Radius (l-prefix)

VariableDefaultDescription
$SSAOPostFx::lRadius1.0Sample radius
$SSAOPostFx::lStrength10.0Occlusion strength
$SSAOPostFx::lDepthMin0.2Minimum depth
$SSAOPostFx::lDepthMax2.0Maximum depth
$SSAOPostFx::lDepthPow0.2Depth power curve
$SSAOPostFx::lNormalTol-0.5Normal tolerance
$SSAOPostFx::lNormalPow2.0Normal power curve

Usage Example

-- Enable SSAO
local ssao = scenetree.findObject("SSAOPostFx")
if ssao then ssao:enable() end

-- Increase quality
TorqueScriptLua.setVar("$SSAOPostFx::quality", "2")
TorqueScriptLua.setVar("$SSAOPostFx::overallStrength", "3.0")

-- Debug visualization
local viz = scenetree.findObject("SSAOVizPostFx")
if viz then viz:enable() end

Notes

  • Defaults are only set on first load (not on Lua reload) to preserve runtime changes
  • The #ssaoMask render target is consumed by the Advanced Lighting (AL) shaders
  • Blur passes exist but their integration is marked as TODO in comments
  • Quality macro QUALITY controls sample count in the shader (0=low, 1=med, 2=high)

See Also

  • PostFx Light Ray - Volumetric light rays
  • Render Manager - AL format token setup

PostFx SMAA Anti-Aliasing

Enhanced Subpixel Morphological Anti-Aliasing (SMAA) post-processing effect. Three-pass pipeline: edge detection, blending weight calculation, and neighborhood blending.

PostFx Turbulence Effect

Screen-space turbulence distortion post-processing effect. Applies a heat-haze or ripple distortion to the back buffer.

On this page

OverviewScene ObjectsGlobal CallbacksConsole VariablesGlobalSmall Radius (s-prefix)Large Radius (l-prefix)Usage ExampleNotesSee Also