RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager
Gen Decal EditorGen Experimental Frame EditorGen Mesh ExplorerGen Experimental SolidFlexGen Mesh ModuleGen Network ModuleGen Region ModuleGen Render ModuleGen Terrain ModuleEditor Gen TestEditor Gen Top (Roof Geometry)Editor Gen UI (Building Architect UI)Editor Gen UtilsEditor Gen World

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 Extensionseditorgen

Gen Decal Editor

Experimental procedural road/decal generation system for the gen editor framework.

Experimental procedural road/decal generation system for the gen editor framework.


Overview

The decal module is part of the experimental gen editor subsystem. It provides procedural road and lane-marking generation using decal-based rendering. Includes road junction logic, lane configuration (left/right lanes, dashed/solid markings), and a simple vehicle driving simulation for testing.


Module Table: D

FieldTypeDescription
D.ui.laneLnumberNumber of left lanes
D.ui.laneRnumberNumber of right lanes
D.ui.middleYellowbooleanWhether center line is yellow
D.ui.middleDashedbooleanWhether center line is dashed
D.ui.tpicknumberActive tool picker index
D.defaulttableDefault road generation parameters
D.outtableOutput table containing avedit, apick, apoint, apath, default

Default Parameters

ParameterDefaultDescription
react_time5AI reaction time
nbranch4Number of junction branches
laneWidth3Lane width in meters
laneNum2Number of lanes
mat"road1_concrete"Road surface material
matline"ChaulkLine"Lane line material
matlinedash"crossing_white"Dashed line material
rjunc~33.3Junction radius
rround20Roundabout radius
radcoeff2Radius coefficient
bank2Road banking angle
wline0.2Line width
rexit20Exit radius
wexit4Exit width
sidemargin0.3Side margin
v2tmin5Min v2t value

Dependencies

ModulePath
Utils/lua/ge/extensions/editor/gen/utils
Render/lua/ge/extensions/editor/gen/render

Usage Example

-- The decal module is loaded as part of the gen editor framework.
-- It uses scene groups to organize generated road objects:
local groupDecal = scenetree.findObject('e_road')
-- Road geometry is created procedurally and added to MissionGroup.

Functions

inject(inreload)

Handles inject.

  • inreload (any)

Returns: rd.ind

clear()

Handles clear.

Returns: end

undo(silent)

Handles undo.

  • silent (boolean)

Returns: ijs

del(ind)

Handles del.

  • ind (any)

Returns: aset

ifRound(r, abr)

Handles if round.

  • r (any)
  • abr (any)

Returns: a.ang < b.ang

matchClear()

Handles match clear.

Returns: end

inMatch(ind)

Handles in match.

  • ind (any)

Returns: end

setCar(pos, ang, lane)

Sets the car.

  • pos (number)
  • ang (any)
  • lane (any)

Returns: end

toMark(list, cname, f, r, op, keepz)

Handles to mark.

  • list (any)
  • cname (any)
  • f (any)
  • r (any)
  • op (any)
  • keepz (any)

road2ter(ilist, precomp, dbg)

Handles road2ter.

  • ilist (any)
  • precomp (any)
  • dbg (any)

decalUp(desc, ext)

Handles decal up.

  • desc (any)
  • ext (any)

Returns: road

epos(rd, i, side)

Handles epos.

  • rd (any)
  • i (number)
  • side (any)

Returns: p

roadLength(rd, side)

Handles road length.

  • rd (any)
  • side (any)

Returns: d,nsec

toPath(p, rd, aind, side, crv, dbg)

Handles to path.

  • p (any)
  • rd (any)
  • aind (any)
  • side (any)
  • crv (any)
  • dbg (any)

Returns: c, c:distance(p), rd.e2d[e1]*(1-s) + rd.e2d[e2]*s, e1

toSide(p, rd, side)

Handles to side.

  • p (any)
  • rd (any)
  • side (any)

Returns: d,p,ifr

onSide(rd, side, dist, margin, dbg)

Callback for side event.

  • rd (any)
  • side (any)
  • dist (any)
  • margin (any)
  • dbg (any)

Returns: rd.list[#rd.list],nsec

borderCross(rda, rdb, sidea, sideb, starta, startb, margin)

Handles border cross.

  • rda (any)
  • rdb (any)
  • sidea (any)
  • sideb (any)
  • starta (any)
  • startb (any)
  • margin (any)

Returns: c,i,j

nodesUpdate(rd, apos, frto, awidth, dbg)

Handles nodes update.

  • rd (any)
  • apos (any)
  • frto (any)
  • awidth (any)
  • dbg (any)

forExitFree(a, b, pa, pb, sidea, sideb)

Handles for exit free.

  • a (any)
  • b (any)
  • pa (any)
  • pb (any)
  • sidea (any)
  • sideb (any)

Returns: edesc

junctionRound(r, w, dbg)

Handles junction round.

  • r (any)
  • w (any)
  • dbg (any)

forPlot(render)

Handles for plot.

  • render (any)

branchMerge(a, b, desc)

Handles branch merge.

  • a (any)
  • b (any)
  • desc (any)

hmapChange(p, h, yes)

Handles hmap change.

  • p (any)
  • h (any)
  • yes (any)

forHSpline(ipin, between)

Handles for h spline.

  • ipin (any)
  • between (any)

Returns: h,h

spline(apar, k, t, s)

Handles spline.

  • apar (any)
  • k (any)
  • t (any)
  • s (any)

Returns: U.spline2(a, b, s)

onVal(key, val)

Callback for val event.

  • key (string)
  • val (any)

Returns: a.ang < b.ang

toTarget(ang, throttle)

Handles to target.

  • ang (any)
  • throttle (any)

decalSplit(rd, p, ext)

Handles decal split.

  • rd (any)
  • p (any)
  • ext (any)

decalPlot(pth, w, ard, ext, dbg)

Handles decal plot.

  • pth (any)
  • w (any)
  • ard (any)
  • ext (any)
  • dbg (any)

decalsLoad(list)

Handles decals load.

  • list (any)

forRoad()

Handles for road.

Returns: croad or #apick --and croad:getField("material", "") ~= 'War

junctionUp(pos, n, inrand, aang)

Handles junction up.

  • pos (number)
  • n (number)
  • inrand (any)
  • aang (any)

Returns: ajunc[#ajunc]

ter2road(pth, cid)

Handles ter2road.

  • pth (any)
  • cid (any)

restore()

Handles restore.

matApply(mat, o)

Handles mat apply.

  • mat (any)
  • o (any)

laneSet()

Handles lane set.

widthRestore()

Handles width restore.

middleUp(rdobj)

Handles middle up.

  • rdobj (any)

sideUp(rdobj)

Handles side up.

  • rdobj (any)

node2edge(rd, dbg)

Handles node2edge.

  • rd (any)
  • dbg (any)

Returns: list

unselect()

Handles unselect.

onUpdate(rayCast)

Callback for update event.

  • rayCast (any)

onSelect()

Callback for select event.

test()

Test function (no-op in production).


See Also

  • Gen Render - Debug rendering utilities
  • Gen Network - Road network generation
  • Gen Region - Region-based procedural generation

Flowgraph Welcome Window

Displays the welcome/start screen for the flowgraph editor with recent files, examples, and demo projects.

Gen Experimental Frame Editor

Experimental frame/skeleton editor for procedural body animation and inverse kinematics.

On this page

OverviewModule Table: DDefault ParametersDependenciesUsage ExampleFunctionsinject(inreload)clear()undo(silent)del(ind)ifRound(r, abr)matchClear()inMatch(ind)setCar(pos, ang, lane)toMark(list, cname, f, r, op, keepz)road2ter(ilist, precomp, dbg)decalUp(desc, ext)epos(rd, i, side)roadLength(rd, side)toPath(p, rd, aind, side, crv, dbg)toSide(p, rd, side)onSide(rd, side, dist, margin, dbg)borderCross(rda, rdb, sidea, sideb, starta, startb, margin)nodesUpdate(rd, apos, frto, awidth, dbg)forExitFree(a, b, pa, pb, sidea, sideb)junctionRound(r, w, dbg)forPlot(render)branchMerge(a, b, desc)hmapChange(p, h, yes)forHSpline(ipin, between)spline(apar, k, t, s)onVal(key, val)toTarget(ang, throttle)decalSplit(rd, p, ext)decalPlot(pth, w, ard, ext, dbg)decalsLoad(list)forRoad()junctionUp(pos, n, inrand, aang)ter2road(pth, cid)restore()matApply(mat, o)laneSet()widthRestore()middleUp(rdobj)sideUp(rdobj)node2edge(rd, dbg)unselect()onUpdate(rayCast)onSelect()test()See Also