Skip to content

Performance: auto-batching & render settings

The engine ships two performance features that need no per-object work from you: transparent draw-call auto-batching, and a scene-level rendering-settings registry that toggles the expensive parts of the pipeline.

Many compatible meshes merged by the auto-batcher into a few draw calls
Auto-batching merges compatible static + dynamic meshes into a handful of draw calls.

Every unique (geometry, material) pair a scene draws is normally its own draw call; thousands of them starve the GPU. The auto-batcher (packages/engine/src/render/auto-batcher.ts, render-batch-system.ts) merges compatible meshes into shared batches — both static geometry and dynamic (per-frame-moving) objects — so a scene that would issue thousands of draw calls issues a handful. On a 100k-object stress scene this is roughly an 8 → 120 fps difference.

It is transparent: you don’t tag anything or call a batch API — the render system batches what it can and leaves the rest as normal draws. It also degrades gracefully (anything that can’t be batched still renders correctly) and is a gated opt-out, so you can turn it off per scene if a case ever misbehaves.

Scenes carry an optional environment.rendering block whose fields come from one registry (packages/engine/src/render/render-features.ts), applied by render-settings.ts. Each is a toggle for an expensive stage, and the editor exposes them in the Rendering section of the environment inspector (select nothing → Environment → Rendering).

SettingDefaultWhat it controls
autoBatchtruethe auto-batcher above
frustumCullingtrueskip objects outside the camera frustum
lodtruelevel-of-detail switching
shadowstrueshadow-map rendering
postProcessingtruethe whole EffectComposer post stack (off → plain render)
resolutionScale1render-target scale (lower = faster, softer)
antialiastrueMSAA / antialiasing
backend"auto"renderer backend selection