The same triangles in 400 trips or in 1
Three ways to draw 400 boxes. Merging gives one mesh that can no longer move its boxes separately; InstancedMesh keeps one position per box.
The GPU is a chip with thousands of small workers that all run the same short program on different data at once. That suits 3D, where the same steps repeat for every corner and every pixel, and it makes the number of draw calls a cost of its own.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
A scene shows 1,000 identical trees. Which technique keeps it at one draw call, and what must you give up?
In TRIPS, write the one-line change that makes the instanced version draw only the first 100 boxes.
Explain it without notes
Why can a scene with 5,000 small separate meshes run slower than a scene with one 5-million-triangle mesh?
What are the vertex shader and the fragment shader, and how many times does each run for one triangle?
Console
Nothing logged yet.Expected console output
400 separate meshes draw calls 400 | triangles 4800
1 merged mesh draw calls 1 | triangles 4800
1 InstancedMesh draw calls 1 | triangles 4800