Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 17.3 — Level of Detail and Culling
3D Web · Example 2 of 2

LOD: three levels, and hysteresis

The triangle counts are for these exact spheres. The bike's own LOD choices come in Topic 19.3.

The cheapest triangle is the one you never send. Frustum culling skips what the camera cannot see; LOD swaps in simpler meshes as objects get far away. Both depend on numbers you must keep true.

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 4 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Add a fourth level to the LOD example: a billboard PlaneGeometry shown beyond 60 m. What do the triangles read at 80 m?

02

A tree sits at 8 m behind a house, inside the camera's view. Is it drawn?

Explain it without notes

01

A mesh with a custom vertex shader disappears when you pan the camera so that its original position leaves the screen. Why, and what are the fixes?

02

Does three.js avoid drawing an object hidden behind another? Explain.

LOD: three levels, and hysteresis
Press Run to see the page.
idle

Console

Nothing logged yet.

Expected console output

camera at  3 m -> level 0 | triangles drawn: 3968
camera at  9 m -> level 0 | triangles drawn: 3968
camera at 11 m -> level 1 | triangles drawn:  224
camera at 29 m -> level 1 | triangles drawn:  224
camera at 31 m -> level 2 | triangles drawn:   36
camera at 80 m -> level 2 | triangles drawn:   36
hovering round 10 m with 10% hysteresis: 0 1 1 1 1
the same path with no hysteresis:       0 1 0 1 0