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

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 Extensionsutil

Ground Model Debug

ImGui-based debug tool for visualizing and editing ground model physics properties in real time.

ImGui-based debug tool for visualizing and editing ground model physics properties in real time.


Overview

util_groundModelDebug provides a comprehensive debug window for ground models (surface physics materials). Displays a color-coded overlay of ground types, allows live editing of friction/fluid parameters, and supports collision density visualization. Uses ImGui for the UI and debugDrawer for 3D rendering.

Extension path: lua/ge/extensions/util/groundModelDebug.lua


Exports (M)

FunctionSignatureDescription
openWindow()Opens the debug window.
onUpdate(dt)Renders debug overlays and the ImGui window.
onExtensionLoaded()Initializes ground model data from core_environment.
onSerialize()Saves window/debug state for hot-reload.
onDeserialized(data)Restores state after hot-reload.

Internals

Ground Model Properties (Editable)

Each ground model exposes sliders for:

PropertyRangeDescription
collisiontype0–30Collision type index.
defaultDepth0–5Surface fluid depth (meters).
dragAnisotropy0–1Vertical drag anisotropy (lift/sink effect).
flowBehaviorIndex0–5Pseudoplastic (<1) / Newtonian (1) / Dilatant (>1).
flowConsistencyIndex0–15000Speed-sensitive drag coefficient.
fluidDensity0–50000Surface fluid density (kg/m³).
hydrodynamicFriction0–0.01Speed-sensitive friction for fluid-like surfaces.
roughnessCoefficient0–1Surface roughness.
shearStrength0–25000Material shear strength.
skidMarksboolWhether skid marks are rendered.
slidingFrictionCoefficient0.1–1.5Kinetic friction.
staticFrictionCoefficient0.1–2.0Static friction.
strength0–2Generic friction multiplier.
stribeckVelocity0–7.5Static-to-sliding friction transition shape.

Debug Modes

ModeDescription
GroundColor-coded ground model type overlay.
DepthSurface depth visualization.
StaticStatic collision geometry debug.
Coltris/m²Collision triangle density heatmap.

Visualization Options

  • Mouse Focus: Raycast from mouse to set debug center point.
  • Distance: Render radius (0–60 units).
  • Tile Size: Debug grid tile size (0.5–1.0).
  • Depth Scale: Depth visualization multiplier.

Collision Density

When enabled, renders a tile grid showing collision triangle density:

  • Configurable tile count, size, and color threshold.
  • Optional text labels showing per-tile counts.

Persistence

Settings (colors, options) are saved to settings/editor/groundModelDebug_settings.json.


How It Works

  1. Call openWindow() or load the extension.
  2. The ImGui window shows all ground models with toggleable visibility and color pickers.
  3. Expand any ground model to edit its physics properties live via be:setGroundModel().
  4. Changes propagate to aliases automatically.
  5. Use the menu to save modified ground models or restore defaults.

Lua Examples

-- Open the debug window
extensions.util_groundModelDebug.openWindow()

-- The window provides:
-- - Toggle visibility per ground model
-- - Color-code customization
-- - Live physics parameter editing
-- - Save/restore ground models

Additional Exports

  • M.onDeserialized - (undocumented)
  • M.onExtensionLoaded - (undocumented)
  • M.onSerialize - (undocumented)
  • M.onUpdate - (undocumented)
  • M.openWindow - (undocumented)

Forest Generator

Procedural forest generation utility for creating, querying, updating, and deleting forest items programmatically.

Input System Utils

Utilities for analyzing and re-formatting input map JSON files. Prints binding statistics and resaves all inputmap files with consistent formatting and sorting.

On this page

OverviewExports (M)InternalsGround Model Properties (Editable)Debug ModesVisualization OptionsCollision DensityPersistenceHow It WorksLua ExamplesAdditional Exports