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 PostFX Manager

Central manager for all post-processing effects (PostFX). Handles initialization, preset loading/saving, backup/restore, and per-effect settings synchronization (SSAO, HDR, DOF, LightRays).

Central manager for all post-processing effects (PostFX). Handles initialization, preset loading/saving, backup/restore, and per-effect settings synchronization (SSAO, HDR, DOF, LightRays).


Module Overview

PropertyValue
Sourcelua/ge/client/postFx.lua
ReturnsModule table M
Dependenciesclient/postFx/* sub-modules

Public Functions

FunctionArgsReturnsDescription
M.initPostEffects--Loads all PostFX sub-modules, loads default preset
M.reloadPostEffects--Re-requires all PostFX sub-modules (hot-reload)
M.applyDefaultPreset--Loads user or default preset, applies settings
M.loadPresetFilefilenamebooleanLoads a .postfx JSON preset file into $PostFXManager::Settings::*
M.savePresetFilefilename-Exports current settings to JSON preset file
M.settingsApplyFromPreset--Applies preset vars to runtime effect vars
M.settingsApplyAll--Copies runtime vars back to preset vars
M.settingsSetEnabledenablePostFX-Enables/disables all PostFX based on per-effect flags
M.applySSAOPreset--Copies $PostFXManager::Settings::SSAO::* → $SSAOPostFx::*
M.applyHDRPreset--Copies $PostFXManager::Settings::HDR1::* → $HDRPostFX::*
M.applyLightRaysPreset--Copies LightRays preset → runtime
M.applyDOFPreset--Copies DOF preset → runtime, calls updateDOFSettings()
M.backupCurrentSettings--Saves current PostFX state to M.backupSettings
M.clearBackup--Clears backup (allows saving current values)

PostFX Sub-Modules Loaded

ModulePostEffect Object
client/postFx/causticsCausticsPFX
client/postFx/chromaticLensChromaticLensPostFX
client/postFx/dofDOFPostEffect
client/postFx/edgeAAEdgeDetectPostEffect, EdgeAAPostEffect
client/postFx/flashFlash overlay
client/postFx/fogFog
client/postFx/fxaaFXAA
client/postFx/GammaPostFXGammaPostFX
client/postFx/glowGlow/bloom
client/postFx/lightRayLightRayPostFX
client/postFx/maskedScreenBlurMasked blur
client/postFx/MotionBlurFxMotionBlurFX
client/postFx/smaaSMAA
client/postFx/ssaoSSAOPostFx
client/postFx/turbulenceTurbulence

Scene Objects Created

ObjectTypePurpose
PFX_DefaultStateBlockGFXStateBlockDataDefault PostFX state: z-off, clamp-linear
PFX_DefaultBlitStateBlockGFXStateBlockDataAlpha-blended blit state
PFX_PassthruShaderShaderDataSimple passthrough shader
AL_FormatBlitPostEffectFormat conversion blit (disabled by default)

Preset File Format

Presets are JSON files (.postfx) with structure:

{
  "header": { "version": 1 },
  "SSAO": { "Enable": true, "quality": "2", ... },
  "HDR1": { "Enable": true, "enableBloom": true, ... },
  "DOF": { "Enable": false, ... },
  "LightRays": { "Enable": true, ... },
  "EnablePostFX": true
}

Preset Search Order

  1. settings/postfxSettings.postfx (user settings)
  2. lua/ge/client/postFx/presets/defaultPostfxPreset.postfx (fallback)

Named Presets

VariableFile
$PostFXManager::highPresetdefaultPostfxPreset.postfx
$PostFXManager::normalPresetlowestPostfxPreset.postfx
$PostFXManager::lowPresetlowestPostfxPreset.postfx
$PostFXManager::lowestPresetlowestPostfxPreset.postfx

Globals Set

GlobalTypeDescription
postEffectCallbackstableDefault onEnabled callback (returns true)

Backup System

-- Backup current settings before making temporary changes
postFxModule.backupCurrentSettings()

-- Later: restore by clearing backup and reapplying preset
postFxModule.clearBackup()
postFxModule.settingsApplyFromPreset()

Backs up DOF, LightRay, HDR, and SSAO runtime variables.


Notes

  • Settings use a two-layer system: $PostFXManager::Settings::* (preset) ↔ $<Effect>::* (runtime).
  • settingsApplyFromPreset copies preset → runtime; settingsApplyAll copies runtime → preset.
  • Includes legacy CS preset migration (settings/default.postfxpreset.cs → JSON).
  • Null graphics device detection skips all PostFX initialization.

Additional Exports

KeySignatureDescription
M.restore_cs_preset_from_json()(No description available)

See Also

  • client/postFx/dof - Depth of Field
  • client/postFx/GammaPostFX - Gamma correction
  • client/postFx/MotionBlurFx - Motion blur
  • client/init - Calls initPostEffects

Additional Functions

restore_cs_preset_from_json()

(No description available)

Client Parse Args

Parses command-line arguments passed to the BeamNG engine, handling flags for logging, display, vehicles, levels, Lua execution, and tech communication.

Render Manager

Initializes the Advanced Lighting (AL) render format token and MSAA copy PostEffect. Ensures driver MSAA does not interfere with deferred lighting passes.

On this page

Module OverviewPublic FunctionsPostFX Sub-Modules LoadedScene Objects CreatedPreset File FormatPreset Search OrderNamed PresetsGlobals SetBackup SystemNotesAdditional ExportsSee AlsoAdditional Functionsrestore_cs_preset_from_json()