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

Client Lighting

Discovers and initializes lighting system backends (Advanced Lighting, Basic Lighting) with fallback logic.

Discovers and initializes lighting system backends (Advanced Lighting, Basic Lighting) with fallback logic.


Module Overview

PropertyValue
Sourcelua/ge/client/lighting.lua
ReturnsModule table M
Dependenciesclient/lighting/*/init.lua (discovered at runtime)

Public Functions

FunctionArgsReturnsDescription
M.initLightingSystems--Discovers and loads lighting backends, activates preferred manager
M.reloadLightingSystems--Same logic as init, used for hot-reload

Initialization Flow

  1. Scan lua/ge/client/lighting/ for init.lua files (depth 1)
  2. require() each discovered lighting backend
  3. Try preferred manager: setLightManager($pref::lightManager)
  4. On failure, iterate defaultLightManagerNames from settings
  5. If all fail: quitWithErrorMessage("Failed to set a light manager!")

Console Variables

VariablePurpose
$pref::lightManagerUser-preferred light manager name

Settings Used

KeyPurpose
defaultLightManagerNamesNewline-separated fallback list of light manager names

Engine Functions Used

FunctionPurpose
setLightManager(name)Activates a named light manager; returns success boolean
GFXInit.getAdapterCount()Graphics adapter count
GFXInit.getAdapterName(i)Check for null device
quitWithErrorMessage(msg)Fatal error exit

Usage Example

local lighting = require("client/lighting")
lighting.initLightingSystems()

-- Hot-reload
lighting.reloadLightingSystems()

Notes

  • Even with a null graphics device, the function does NOT return early (would crash later).
  • Both initLightingSystems and reloadLightingSystems have identical logic.
  • The discovered backends register themselves (e.g., "Advanced Lighting", "Basic Lighting").

See Also

  • client/lighting/advanced/init - Advanced Lighting backend
  • client/lighting/basic/init - Basic Lighting backend
  • client/init - Calls initLightingSystems

Shadow Maps Init

Registers the box-filter blur shader used for shadow map processing.

PostFx Light Ray Effect

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

On this page

Module OverviewPublic FunctionsInitialization FlowConsole VariablesSettings UsedEngine Functions UsedUsage ExampleNotesSee Also