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 Flash Effect

Screen flash post-processing effect for damage and whiteout visual feedback. Creates a `FlashFx` PostEffect driven by shader constants for damage flash intensity and whiteout amount.

Screen flash post-processing effect for damage and whiteout visual feedback. Creates a FlashFx PostEffect driven by shader constants for damage flash intensity and whiteout amount.


Overview

This file is a declarative setup script (no M module). It registers:

  • PFX_FlashShader - ShaderData for the flash pixel shader
  • FlashFx - PostEffect (disabled by default, priority 10, renders after diffuse)
  • FlashFxCallbacks - Global callback table with setShaderConsts

The effect composites a white/red flash over the back buffer based on damage and whiteout parameters.


Scene Objects

ObjectTypeDefault EnabledDescription
PFX_FlashShaderShaderData-Flash pixel shader with configurable white/mul colors
FlashFxPostEffectfalseScreen flash overlay, renders PFXAfterDiffuse

Global Callbacks

The table FlashFxCallbacks is set on _G via rawset.

CallbackDescription
setShaderConsts()Sets $damageFlash and $whiteOut shader constants (currently hardcoded to 0)

Shader Defines

-- White and multiply colors configured as shader defines
pfxFlashShader:setField("defines", 0,
  "WHITE_COLOR=float4(1.0,1.0,1.0,0.0);MUL_COLOR=float4(1.0,0.25,0.25,0.0)")

Usage Example

-- Enable the flash effect
local flashFx = scenetree.findObject("FlashFx")
if flashFx then
  flashFx:enable()
end

-- The callback updates shader uniforms each frame
-- damageFlash and whiteOut are intended to come from Game.getDamageFlash() / Game.getWhiteOut()

Notes

  • Both damageFlash and whiteOut are hardcoded to 0 with TODO comments indicating they should come from engine functions
  • The effect reads from $backBuffer and renders at priority 10
  • Reflection passes are excluded (allowReflectPass = false)

See Also

  • PostFx Fog - Fog post-processing
  • PostFx Utils - Preset load/save for post effects

Edge AA PostFX

Two-pass edge-detect anti-aliasing: first pass detects edges from the prepass buffer, second pass smooths them.

PostFx Fog Effects

Atmospheric fog and underwater fog post-processing effects. Creates two independent PostEffect chains for above-water and underwater fog rendering.

On this page

OverviewScene ObjectsGlobal CallbacksShader DefinesUsage ExampleNotesSee Also