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 Render Module

Debug rendering utilities for the gen editor framework - paths, points, labels, and circles.

Debug rendering utilities for the gen editor framework - paths, points, labels, and circles.


Overview

The render module provides lightweight debug drawing functions using BeamNG's debugDrawer and FFI-based line batching. It renders paths (polylines), point sets (spheres), text labels, and circles in 3D space. Used throughout the gen editor for visualizing procedural geometry.


Functions

FunctionSignatureDescription
Render.graph(apath, c, w, z)(table, table?, number?, boolean?)Draws an array of polyline paths
Render.path(apoint, c, w, dd, z)(table, ColorF?, number?, boolean?, boolean?)Draws a single polyline path
Render.set(set, c, w)(table, table?, number?)Draws points as spheres, size scaled by camera distance
Render.label(list, c, w)(table, table?, number?)Draws 3D text labels at positions
Render.sphere(pos, r, c)(vec3, number, table)Draws a sphere scaled by camera distance; c = {r,g,b,a}
Render.circle(center, r, c, w, dd)(vec3, number, color?, number?, boolean?)Draws a circle in the XY plane using line segments

Local Helpers

FunctionDescription
toLineBuf(u, v, pos)Writes two vec3 endpoints into the FFI float buffer
pathUp(buf, nStep, c, w)Submits the line buffer to the engine's debug draw system

Color Format

Colors are passed as tables {r, g, b, a} with values 0–1, then converted internally:

  • Render.graph/set → ColorF(r, g, b, a)
  • circle (non-debug) → color(r*255, g*255, b*255)

Performance

The module uses an FFI float buffer (float[6000]) for batch line rendering via BNG_DBG_DRAW_LineInstance_MinArgBatch, which is significantly faster than individual drawLine calls for large path sets.


Usage Example

local Render = require('/lua/ge/extensions/editor/gen/render')

-- Draw a path in yellow, width 2
Render.graph({{vec3(0,0,0), vec3(10,0,0), vec3(10,10,0)}}, {1,1,0,1}, 2)

-- Draw points as spheres
Render.set({vec3(5,5,0), vec3(15,5,0)}, {1,0,0,1}, 0.05)

-- Draw text labels
Render.label({{"Start", vec3(0,0,0)}, {"End", vec3(10,10,0)}}, {0,0,1,1})

See Also

  • Gen Mesh - 3D mesh construction
  • Gen Network - Road network geometry
  • Gen Decal - Road decal rendering

Gen Region Module

Region-based procedural urban generation system for buildings, blocks, and road layouts.

Gen Terrain Module

Procedural terrain and road lattice generation module for the gen editor.

On this page

OverviewFunctionsLocal HelpersColor FormatPerformanceUsage ExampleSee Also