Skip to content

Static Objects & Batching ​

Marking scenery Static tells Awaken3D an object never moves, which lets the renderer merge many objects into a single draw call and gives physics a simpler, fixed body. This page explains what the flag does and when to use it.

The Static flag ​

Static is an entity-level flag (not a component): it's either on or off for a whole object. Set it from the Inspector or the Hierarchy's right-click menu, on one object or a whole multi-selection at once. It's an undoable edit, and it's saved in the scene (an object is only written as static: true when the flag is on).

The flag is a promise: this object's transform will not change at runtime. Two systems act on that promise.

πŸ“Έ Screenshot - save as img/world-static-flag.png

The Inspector header of a selected building with the Static checkbox ticked, and the stats overlay showing the "Static … merged" count.

What marking Static does ​

1. Render batching (index-merge) ​

Drawing thousands of separate scenery meshes is expensive - each is a draw call. Static batching collapses many of them into a few.

Awaken3D uses an index-merge scheme. Static meshes that share a texture and sit in the same spatial cell are concatenated into one merged mesh and drawn together. Crucially, world transforms are not baked into the merged geometry: every vertex keeps its object's local position and carries an objIndex that selects that object's matrix from a stable per-object transform buffer in the shader.

Objects are bucketed by spatial cell so frustum culling still works at chunk granularity - a chunk of scenery off-screen is culled as a unit. Opaque and alpha-blended statics go into separate chunks so blending still sorts correctly.

Two kinds of static object are kept off the merge and drawn per-object instead: one with a MeshMaterial (its custom shader can't run through the material-blind static pipeline), and one with shadow casting turned off. Everything else static falls back to per-object drawing once the Batch threshold or merge budget is reached.

2. A fixed physics body ​

For physics, a static object with a collider becomes a fixed body - immovable world geometry that other bodies collide against but that never itself responds to forces. This is exactly what you want for floors, walls, and terrain.

Repeated meshes stay instanced ​

Not everything should merge. A mesh used many times (a fence post placed 500 times) is already efficient to draw with GPU instancing - one upload, many transforms. Merging those would duplicate the geometry hundreds of times and blow up memory.

So batching only merges low-repeat static meshes. A mesh is merged only if its use count is at or below the Batch threshold; heavily-repeated meshes are left instanced. The result: unique scenery merges into a few draws, and repeated scenery stays instanced.

Moving a static object is cheap ​

The "static" promise is about the common case, not a hard lock. Because the merge keeps per-object transforms in a separate buffer, moving a static object is a single transform-slot write - no re-merge, no geometry rebuild. Only adding, removing, or moving an object across a cell boundary rebuilds the affected chunk. In practice you can nudge static scenery in the editor freely; you just shouldn't animate it every frame from a script (use a non-static object for that).

Settings ​

Static batching is tuned in Render Settings:

SettingDefaultRangeWhat it controls
Static batchingonon/offMaster toggle for merging static scenery.
Batch threshold≀ 8 uses1–32Only meshes used at most this many times are merged; more-repeated meshes stay instanced.
Merge budget8M verts4–32MHow much geometry to merge into chunks before falling back to per-object draws. Raise on heavy scenes to cut draw calls; costs merged-geometry GPU memory.

Watch the Draw calls and Static … merged figures in the Viewport stats overlay while you tune these - the goal is fewer draw calls without exhausting memory.

πŸ“Έ Screenshot - save as img/world-render-settings-batching.png

The Render Settings panel showing the Static batching toggle, Batch threshold slider, and Merge budget slider.

When to use it ​

  • Do mark non-moving scenery: buildings, walls, floors, terrain decoration, static props - especially many unique small meshes that share a texture.
  • Don't mark objects that move under script or physics each frame (doors, platforms, characters, pickups that spin) - keep those non-static so the renderer treats them as dynamic.

See also ​

Awaken β€” browser-native WebGPU game engine.