Command Palette

Search for a command to run...

Hectal
Phase 1: How a Screen Draws 3D
3D Web · Exercise 2 of 5 PreviousNext
Beginner

A hundred boxes, one draw call

This scene draws 100 boxes as 100 separate meshes: 100 draw calls.

Draw the same 100 boxes with an InstancedMesh so the scene needs at most 2 draw calls, and the boxes stay in the same places.

What Check tests

  1. There is an InstancedMesh with 100 instances
  2. At most 2 draw calls
  3. The renderer draws 1,200 triangles (100 boxes)
  4. The instance at index 99 is in its place (1.35, 1.35)

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.