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

Client Core

Initializes core rendering resources: materials, shaders, state blocks, and sampler states required by the engine's rendering pipeline.

Initializes core rendering resources: materials, shaders, state blocks, and sampler states required by the engine's rendering pipeline.


Module Overview

PropertyValue
Sourcelua/ge/client/core.lua
ReturnsModule table M
Dependenciesclient/canvas, client/objectsRequiredForStartup

Public Functions

FunctionArgsReturnsDescription
M.loadCoreMaterials--Creates common materials and track builder materials, loads .materials.json files
M.initializeCore--Full one-time core init: seed RNG, canvas, materials, shaders, water, sky, clouds, vehicles
M.reloadCore--Reinitializes canvas on hot-reload

Initialization Sequence (initializeCore)

  1. setRandomSeed(-1) - seed RNG
  2. require("client/objectsRequiredForStartup") - GUI profiles, cursor
  3. canvas_module.initializeCanvas() - create render window
  4. M.loadCoreMaterials() - common + track builder + JSON materials
  5. createCommonMaterialData() - sampler states
  6. createShaderData() - particles, reflections, foliage, terrain shaders
  7. createWaterShaderData() - water/underwater shaders and materials
  8. createScatterSkyData() - scatter sky shader
  9. createCloudsData() - cloud layer and basic clouds shaders
  10. createVehicleData() - prop selection shader/material

Scene Objects Created (Key Subset)

Shaders

ObjectTypePurpose
CorePassthruShaderVPShaderDataPassthrough vertex/pixel shader
ParticlesShaderDataShaderDataParticle rendering
ReflectBumpShaderDataPlanar reflection with bump map
TerrainBlendShaderShaderDataTerrain base texture blending
WaterShaderShaderDataWater surface rendering
ScatterSkyShaderDataShaderDataAtmospheric scattering sky

Materials

ObjectTypePurpose
WarningMaterialMaterialMissing-texture fallback (warn pattern)
BlankWhiteMaterialBlank white diffuse
Corona_MatMaterialLight corona FX
BlackSkyMat / BlueSkyMat / GreySkyMatMaterialSolid-color sky cubemaps
WaterMat / UnderwaterMatCustomMaterialWater rendering
track_editor_*MaterialTrack builder road surfaces (A–H variants)

Sampler States

ObjectFilterAddress Mode
SamplerClampLinearLinearClamp
SamplerClampPointPointClamp
SamplerWrapLinearLinearWrap
SamplerWrapPointPointWrap

Console Variables Set

VariableValuePurpose
$scroll"1"Material animation flag
$rotate"2"Material animation flag
$wave"4"Material animation flag
$scale"8"Material animation flag
$sequence"16"Material animation flag

Usage Example

-- Called internally by client/init.lua
local core = require("client/core")
core.initializeCore()

-- Hot-reload path
core.reloadCore()

Notes

  • initializeCore is guarded by M.initialized to prevent double-init.
  • All objects use find-or-create pattern: scenetree.findObject() before createObject().
  • Track builder materials come in A–H variants, each with _center and _border sub-materials.
  • JSON materials are loaded recursively from core/ directory.

See Also

  • client/canvas - Canvas initialization
  • client/init - High-level client init calling initializeCore
  • client/objectsRequiredForStartup - GUI profiles

Chromatic Lens PostFX

Chromatic aberration and lens distortion post-processing effect.

Depth of Field PostFX

Multi-pass depth-of-field post-processing effect with auto-focus support (vehicle tracking or center raycast) and configurable near/far blur equations.

On this page

Module OverviewPublic FunctionsInitialization Sequence (initializeCore)Scene Objects Created (Key Subset)ShadersMaterialsSampler StatesConsole Variables SetUsage ExampleNotesSee Also