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
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorExport (glTF)Follow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track (Gymkhana Generator)Rectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot Creator (Vehicle Thumbnails)ShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files Syntaxutil/vehicleRopeDebug - Rope Physics Debug UIutil/worker - Batch Job Workerutil/wsTest - WebSocket Test Server
Track Builder - Basic BordersTrack Builder - Basic CentersTrack Builder - Border Wall MeshTrack Builder - Camera TransitionTrack Builder - Ceiling MeshtrackBuilder/markers - Track Marker Interpolation & VisualizationtrackBuilder/materialUtil - Track Material ManagementtrackBuilder/meshes - Cross-Section Mesh DefinitionstrackBuilder/multiTrackMerger - Track Intersection MergingtrackBuilder/obstaclePlacer - Track Obstacle PlacementtrackBuilder/pieces - Track Piece Geometry GenerationtrackBuilder/proceduralPrimitives - Procedural 3D Primitive GeneratorstrackBuilder/quickraceSetup - Quick Race Track LoadertrackBuilder/segmentToProceduralMesh - Segment Mesh GeneratortrackBuilder/splineTrack - Main Track Builder Engine

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 ExtensionsutiltrackBuilder

Track Builder - Basic Borders

Generates left and right border mesh geometry for track segments in the track builder system.

Generates left and right border mesh geometry for track segments in the track builder system.


Overview

util_trackBuilder_basicBorders provides border cross-section shapes (regular, bevel, racetrack, rail, etc.) and compiles them into 3D mesh data (vertices, normals, UVs, faces) for track segment borders. Each side of the track gets an independent mesh with configurable shape and material.

Module path: lua/ge/extensions/util/trackBuilder/basicBorders.lua


Exports (M)

FunctionSignatureDescription
getMeshes(segment) → tableReturns an array of left and right border mesh data tables for the segment.

Internals

Available Shapes

ShapeDescription
regularStandard barrier profile with curved top.
bevelRounded quarter-circle profile.
smoothedRectThin rectangular profile with smoothed edges.
racetrackWide racetrack barrier with raised wall section.
smallDiagonalSmall diagonal wall profile.
bigDiagonalLarger diagonal wall profile.
wideBevelWide barrier with parabolic top curve.
highBevelTall barrier with high parabolic top.
railCircular rail tube mounted on a flat base.
noneInvisible / no border (just two edge points).

Shape Structure

Each shape defines:

  • crossPoints - array of {point = vec3, uv = number, sharp = bool} defining the 2D profile.
  • cap - triangle indices for start/end caps.
  • faces - groups of vertex indices forming face strips.
  • faceInfo - precomputed face/normal/cap data (computed on module load).

Mesh Compilation (compileMeshInfo)

For each track point that passes the quality filter:

  1. Cross-section vertices are transformed into world space using the point's orientation, width, and position.
  2. Normals are rotated similarly.
  3. UVs use the cross-section uv for U and point.uvY * uvHeight for V.
  4. Faces connect consecutive cross-sections into quads.
  5. Optional start/end caps are added based on segment meshInfo.

Quality Levels

At quality level 4, borders degrade to the none shape (invisible).

Output Format

{
  verts = {{x,y,z}, ...},
  uvs = {{u,v}, ...},
  normals = {{x,y,z}, ...},
  faces = {{v, n, u}, ...},
  material = "track_editor_A_border",
  tag = "side 1" or "side -1"
}

How It Works

  1. Track builder assigns leftMesh and rightMesh shape names to each segment.
  2. getMeshes(segment) compiles both sides into mesh data.
  3. The mesh data is passed to the ProceduralMesh system for rendering.

Lua Examples

-- Used internally by the track builder pipeline:
local borderMeshes = extensions.util_trackBuilder_basicBorders.getMeshes(segment)
-- Returns array: {leftMeshData, rightMeshData}

Additional Exports

  • M.getMeshes - (undocumented)

util/wsTest - WebSocket Test Server

Reference for `extensions/util/wsTest.lua`. Runs a local WebSocket server for testing GE Lua execution, reloads, and bandwidth measurements from a browser.

Track Builder - Basic Centers

Generates center road surface mesh geometry for track segments in the track builder system.

On this page

OverviewExports (M)InternalsAvailable ShapesShape StructureMesh Compilation (compileMeshInfo)Quality LevelsOutput FormatHow It WorksLua ExamplesAdditional Exports