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.
| Property | Value |
|---|
| Source | lua/ge/client/core.lua |
| Returns | Module table M |
| Dependencies | client/canvas, client/objectsRequiredForStartup |
| Function | Args | Returns | Description |
|---|
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 |
setRandomSeed(-1) - seed RNG
require("client/objectsRequiredForStartup") - GUI profiles, cursor
canvas_module.initializeCanvas() - create render window
M.loadCoreMaterials() - common + track builder + JSON materials
createCommonMaterialData() - sampler states
createShaderData() - particles, reflections, foliage, terrain shaders
createWaterShaderData() - water/underwater shaders and materials
createScatterSkyData() - scatter sky shader
createCloudsData() - cloud layer and basic clouds shaders
createVehicleData() - prop selection shader/material
| Object | Type | Purpose |
|---|
CorePassthruShaderVP | ShaderData | Passthrough vertex/pixel shader |
ParticlesShaderData | ShaderData | Particle rendering |
ReflectBump | ShaderData | Planar reflection with bump map |
TerrainBlendShader | ShaderData | Terrain base texture blending |
WaterShader | ShaderData | Water surface rendering |
ScatterSkyShaderData | ShaderData | Atmospheric scattering sky |
| Object | Type | Purpose |
|---|
WarningMaterial | Material | Missing-texture fallback (warn pattern) |
BlankWhite | Material | Blank white diffuse |
Corona_Mat | Material | Light corona FX |
BlackSkyMat / BlueSkyMat / GreySkyMat | Material | Solid-color sky cubemaps |
WaterMat / UnderwaterMat | CustomMaterial | Water rendering |
track_editor_* | Material | Track builder road surfaces (A–H variants) |
| Object | Filter | Address Mode |
|---|
SamplerClampLinear | Linear | Clamp |
SamplerClampPoint | Point | Clamp |
SamplerWrapLinear | Linear | Wrap |
SamplerWrapPoint | Point | Wrap |
| Variable | Value | Purpose |
|---|
$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 |
-- Called internally by client/init.lua
local core = require("client/core")
core.initializeCore()
-- Hot-reload path
core.reloadCore()
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.