Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 12.5 — Vertex Displacement
3D Web · Example 2 of 2

Displaced far, culled early

Nothing is drawn on screen until frustumCulled is turned off, and then the panel appears.

A vertex shader can move vertices: waves, wind, a swelling balloon. Lighting then needs a new normal, and three.js needs to know the mesh is no longer where its bounding sphere says.

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.

01

Add a second wave that travels along z and update the normal.

02

Make the wave amplitude a uniform uAmplitude that you can change from JavaScript.

Explain it without notes

01

Why does a wave look flat if you only move the vertices?

02

Why can a displaced mesh disappear when it is still on screen?

Displaced far, culled early
Press Run to see the page.
idle

Console

Nothing logged yet.

Expected console output

frustumCulled = true (default) triangles drawn: 0
frustumCulled = false          triangles drawn: 2
bounding sphere centre y: 0 | radius: 0.72