production · 30 minute study
Choose the representation that fits the scene
Four hundred individually reasonable props can make an unreasonable scene. Budget the assembled workload and choose representations that preserve what the player can perceive.
Useful preparation · 1 prerequisite
Use this as a map, not a lock. If these ideas are familiar, continue.
- Treat the asset export as a build — The editable Blender scene is a source project. The browser consumes an exported artifact. A reliable pipeline checks the contract at that boundary instead of trusting an attractive authoring screenshot.
First, build a mental model
A scene is a collection of repeated costs: data to transfer, data to decode, resources to allocate, commands to submit and pixels to shade. Optimization changes one representation to reduce a demonstrated cost while preserving the visual and gameplay contract.
- Count draw submissions, visible geometry, texture allocation and shaded pixels separately. Fewer triangles do not automatically reduce draw calls; fewer files do not automatically reduce texture memory. Measure the limiting stage in the assembled scene.
- Instancing can reuse one geometry and compatible material across many transforms. It is useful for repeated props, but multiple materials, render passes, transparency and visibility requirements still affect the actual draw workload.
- Level of detail selects cheaper representations when fine detail contributes little to the image. Distance can be a useful signal, but projected size and visible transitions matter. A small distant object should not consume a hero asset's full shading and geometry budget.
- An atlas can combine image regions, while compression can reduce a particular representation's size. Both introduce trade-offs such as padding, filtering, decoder support or quality loss. Evaluate the exact representation changed and keep a fallback where required.
- Validate the artifact manifest against explicit limits: bytes, dimensions, materials, meshes, clips and bounds. Then test the complete scene on representative devices. Passing numerical gates does not prove that a silhouette, animation or readable interaction survived.
import * as THREE from "three";
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshStandardMaterial({ color: 0x77bb88 });
const count = 400;
const props = new THREE.InstancedMesh(geometry, material, count);
const transform = new THREE.Object3D();
for (let index = 0; index < count; index += 1) {
transform.position.set((index % 20) * 2, 0, Math.floor(index / 20) * 2);
transform.updateMatrix();
props.setMatrixAt(index, transform.matrix);
}
props.instanceMatrix.needsUpdate = true;
props.computeBoundingSphere();
// scene.add(props) in a scene owner with a suitable camera and lighting.
// Shared geometry/material ownership is explicit; avoid disposing per instance.
// Compare measured submissions and frame time, not only object count.- Repeated data
Four hundred props use the same box geometry and material. Their individual transforms are the differing information.
- Representation
The instanced mesh stores the shared resources once with an instance transform for each prop. The renderer can submit compatible instances together for a pass.
- Verification
Measure the assembled scene, including shadow or other passes, and inspect bounds and visibility. The code's object count is not a complete draw-call measurement.
Production thinking
Take this beyond the example.
Ship the smallest artifact that satisfies the intended experience, with traceable source, deterministic naming and cache-safe versions. Lazy-load scene-specific assets and release unused resources through their owners. Keep measured baselines for mobile and sustained sessions. Numerical validation, unit tests, loader smoke checks and visual review are complementary evidence, not interchangeable success labels.
Sources and further reading
Your evidence
unseen is a local learning signal, not a credential or proof of production competence.
Explain the mental model, then explicitly acknowledge it. Opening a page is not evidence.
Supported retries can complete this lesson. Independent evidence and delayed review determine the skill stage.