RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorVehicle ExporterFollow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track GeneratorRectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot CreatorShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files SyntaxVehicle Rope DebugBatch WorkerWebSocket Test
Basic BordersBasic CentersBorder Wall MeshCamera TransitionCeiling MeshTrack MarkersMaterial UtilTrack MeshesMulti Track MergerObstacle PlacerTrack PiecesProcedural PrimitivesQuickrace SetupSegment To Procedural MeshSpline Track

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

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)

See Also

  • Track Builder - Basic Centers - Related reference
  • Track Builder - Border Wall Mesh - Related reference
  • Track Builder - Camera Transition - Related reference
  • Game Engine Overview - Guide

WebSocket Test

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

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 ExportsSee Also