8.1 Purpose
Define performance targets, typical bottlenecks, and optimization techniques for levels.
Optimization should happen throughout production, not only at the end. It is much easier to keep a level fast while building it than to fix an already fully dressed map.
8.2 Core concepts
Performance is driven by a lot of different elements. The list below present some of the major areas to keep under control.
-
Draw calls
- A draw call is the CPU telling the GPU to render a batch of geometry with a specific mesh/submesh, material/shader, and render state. Changing material, submesh, render pass (base, shadow, depth), or camera view creates a new draw call. Each call has CPU cost, so many small or diverse objects can bottleneck.
- Quick examples
- One mesh, one material: 1 draw call
- One mesh with 3 materials/submeshes: 3 draw calls.
- 100 identical props:
- Without batching/instancing: ~100 draw calls.
- With GPU instancing (same material): ~1 draw call.
- UI using one atlas/material: often 1 draw call; separate materials: ~1 per element.
- Decals: typically ~1 draw call per decal.
-
Overdraw
- Overdraw is how many times the same screen pixel gets shaded because multiple triangles or transparent layers overlap there. Each extra layer re-runs the pixel shader (and often blending), increasing GPU fill-rate cost. Opaque geometry with depth testing can minimize overdraw; transparency usually increases it.
Quick examples
- Dense alpha-blended foliage/grass cards: very high overdraw (many overlapping leaves).
- Particle smoke/fog: lots of overlapping quads = heavy overdraw.
- Multiple decals on the same surface: each decal adds another layer to shade.
- Looking through several glass/window panes: each pane adds a layer.
-
Triangle count
-
Texture memory
-
Decalroads amount
-
Dynamic lights
-
Vegetation density
-
Collisions complexity
Early, recurring profiling avoids costly late fixes.
Profile in representative places: a long vista, a dense forest, a dense urban area, a tunnel/interior, a road with many decals, and a night scene with lights.
8.3 Guidelines and budgets
- Geometry: keep triangle counts proportional to distance and importance; use LODs for large assets.
- Materials: limit unique materials per view; reuse and atlas where possible.
- Textures: Texture Cooker PNG only; use power-of-two sizes and mipmaps; choose the smallest size that holds up at driving distance.
- Vegetation: control species count and density; prefer impostors/far LODs where available.
- Lights: keep local dynamic light counts conservative.
Practical rules:
- Reuse materials across related props instead of creating one-off materials for every object.
- Prefer atlases or trim sheets for small repeated details.
- Use Forest or GroundCover for repeated natural scatter instead of many separate static objects.
- Avoid high collision detail on objects that vehicles cannot reach.
- Add LODs for objects that remain visible at distance.
- Keep decal and DecalRoad overlap intentional; every extra layer has a cost.
8.3.1 What to optimize first
When a scene is slow, check the biggest cost first:
- Too many unique materials or draw calls in view.
- Dense vegetation or ground cover.
- Too many dynamic lights or shadow-casting lights.
- High overdraw from transparent foliage, glass, particles, or decals.
- Very large textures or too many high-resolution textures visible together.
- Heavy collision meshes on frequently touched objects.
Do not reduce visual quality randomly. Find the actual bottleneck, then adjust the content that causes it.
8.4 Visibility and overdraw
- Avoid coplanar overlaps (roads/decals/intersections).
- Reduce large, opaque surfaces stacked in the same view.
- Use occlusion/visibility tools where applicable (e.g., tunnels, enclosed spaces).
Overdraw is especially common in:
- Grass and leaf cards
- Dense bushes
- Layered decals
- Glass, fences, and alpha-tested materials
- Smoke, dust, fog, or rain effects
For vegetation, fewer larger clumps are often cheaper than many tiny overlapping cards. For roads and markings, remove hidden decal layers below newer ones.
8.5 Terrain considerations
- Match heightmap resolution to level size.
- Tune terrain LOD and draw distance for target hardware.
- Keep terrain material layer count manageable.
8.5.1 Collision considerations
Collision is part of performance and gameplay quality.
- Use simple collision meshes for buildings, walls, props, and barriers.
- Avoid visible mesh collision unless the object really needs it.
- Split large collision objects logically when it improves stability.
- Disable collision for small decorative objects that vehicles should not hit.
- Test collision at speed, not only by slowly driving over it.
Bad collision can feel like bad road design: invisible bumps, sticky edges, tire snags, or sudden impacts.
8.6 Profiling
- Use the in‑engine profiler and statistics overlays in representative areas (dense forest, urban cluster, long vistas).
- Verify frame time stability during sustained driving.
Profile these cases before release:
- Default spawn view
- Fast drive through the main route
- Dense vegetation area
- Urban/detail-heavy area
- Night scene with active lights
- Water/reflection view
- Worst long-distance vista
Keep notes while profiling. If a later change makes the level slower, you need to know which area changed.
8.7 Validation criteria
- Stable frame times across dressed areas and long road sections.
- No hotspots caused by excessive materials, decals, or lights.
- Texture memory within acceptable limits for target hardware.
- Collision is simple enough to be stable and cheap.
- LODs, impostors, and draw distances do not produce obvious popping while driving.
- Performance remains acceptable after a full reload, not only during an editor session.
See also: Props, buildings, and prefabs
, Vegetation
, Materials
, Testing and validation
.