RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
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

Advanced Lighting - Light Visualization

Debug visualization post effects for the Advanced Lighting deferred rendering pipeline: depth, normals, light color, light specular, and annotation buffers.

Debug visualization post effects for the Advanced Lighting deferred rendering pipeline: depth, normals, light color, light specular, and annotation buffers.


Module Overview

PropertyValue
Sourcelua/ge/client/lighting/advanced/lightViz.lua
Returns- (side-effect module)
DependenciesSampler states from client/core

PostEffect Visualizers

PostEffectShaderVisualizes
AL_DepthVisualizeAL_DepthVisualizeShaderDepth buffer (color-mapped via depthviz.png)
AL_NormalsVisualizeAL_NormalsVisualizeShaderWorld-space normals from prepass
AL_LightColorVisualizeAL_LightColorVisualizeShaderLight info buffer (diffuse)
AL_LightSpecularVisualizeAL_LightSpecularVisualizeShaderLight info buffer (specular)
AnnotationVisualizeAnnotationVisualizeShaderAnnotation buffer overlay

All render at priority 9999 to $backBuffer.


State Blocks

ObjectPurpose
AL_DepthVisualizeStateZ-disabled, point sampling for prepass + depth
AL_DefaultVisualizeStateAlpha-blended overlay, z-disabled

Global Functions

FunctionArgsDescription
toggleLightVisualizerobjName, enable, tsVariableToggle/enable/disable a visualizer PostEffect
toggleAnnotationVisualizeenableToggle annotation buffer overlay
toggleDepthVizenableToggle depth visualization
toggleNormalsVizenableToggle normals visualization
toggleLightColorVizenableToggle light color visualization
toggleLightSpecularVizenableToggle light specular visualization

Global Callback Tables

GlobalPurpose
AL_DepthVisualizeCallbacksonEnabled - deactivates previous viz mode
AL_NormalsVisualizeonEnabled callback
AL_LightColorVisualizeCallbacksonEnabled callback
AL_LightSpecularVisualizeCallbacksonEnabled callback
AnnotationVisualizeCallbacksonEnabled / onDisabled - controls Engine.Annotation.enable()

Usage Example

-- Toggle depth visualization from console
toggleDepthViz(true)

-- Toggle off
toggleDepthViz(false)

-- Toggle (flip current state)
toggleDepthViz()

Notes

  • Only one visualizer can be active at a time; enabling one disables the previous.
  • Annotation visualization requires Engine.Annotation module to exist.
  • All visualizer PostEffects are disabled by default.

See Also

  • client/lighting/advanced/init - Advanced Lighting init
  • client/lighting/advanced/shadowViz - Shadow visualization

PostFx Light Ray Effect

Volumetric light ray (god ray) post-processing effect. Two-pass pipeline: occlusion detection followed by radial light scattering.

PostFx Masked Screen Blur

Masked Gaussian screen blur effect using a texture mask to selectively blur screen regions. Uses DOF-style Gaussian blur shaders with a blend pass.

On this page

Module OverviewPostEffect VisualizersState BlocksGlobal FunctionsGlobal Callback TablesUsage ExampleNotesSee Also