RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
HDR Post-ProcessingOpenXR VRRender ViewsOffscreen View Demo

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 Extensionsrender

Offscreen View Demo

A minimal example extension demonstrating how to create and display an offscreen render view in an ImGui window. The camera orbits the origin.

A minimal example extension demonstrating how to create and display an offscreen render view in an ImGui window. The camera orbits the origin.


Public API

FunctionSignatureDescription
M.onUpdate(dtReal, dtSim, dtRaw)Creates render view (once), updates camera, draws ImGui window

Internals

  • Render view name: "Demo view 1" - unique identifier for the view
  • Resolution: 512 × 256 pixels
  • Camera: Orbits the origin using sin(timer) / cos(timer) at height 1.5
  • FOV: 75°, near clip 0.1, far clip 2000
  • Editor icons: Enabled (renderEditorIcons = true)

How It Works

  1. On first onUpdate, creates a render view via RenderViewManagerInstance:getOrCreateView
  2. Sets luaOwned = true so Lua GC manages the view's lifetime
  3. Configures camera matrix, resolution, viewport, frustum, and named texture target
  4. Each frame, updates the camera position to orbit the origin
  5. Uses debugDrawer:drawTextAdvanced to draw text visible only in that view
  6. Displays the rendered texture in an ImGui window using imUtils.texObj('#' .. renderViewName)

Usage Examples

-- Load the demo extension
extensions.load('render_viewDemo')

-- The demo ImGui window appears automatically showing the orbiting camera view
-- Unload to stop:
extensions.unload('render_viewDemo')

Key Notes

  • The # prefix in imUtils.texObj('#Demo view 1') references a named texture target
  • The render view persists as long as the extension is loaded
  • Camera orbits at radius 1.0 around (0, 0, 1.5)
  • Demonstrates DebugDrawer text scoped to a specific render view (commented out target view code)
  • Good reference for creating picture-in-picture or security camera effects

See Also

  • Render HDR - Post-Effect Pipeline Initialization - Related reference
  • Render OpenXR - VR/XR Runtime Management - Related reference
  • Render Views - Offscreen Camera Screenshots - Related reference
  • Game Engine Overview - Guide

Render Views

Provides a utility to create offscreen render views and save them to disk. Used for programmatic screenshots from arbitrary camera positions.

Bus Driver

M.dependencies = {'scenario_scenarios', 'core_groundMarkers'}

On this page

Public APIInternalsHow It WorksUsage ExamplesKey NotesSee Also