The grid is the shape.
Geometry supplies points and triangles. More segments let a wave bend smoothly; the shader does not create extra vertices.
THREE.JS · HANDS-ON STUDY 01
A shader is a small program that runs on the GPU. First move the vertices. Then decide how the surface catches light.
This static diagram is not a WebGL render. You can still read the guide and run the numeric exercises.
Preparing the local renderer…
Starts paused. Each step advances time without continuous motion.
PREDICT → CHANGE → OBSERVE
Choose stage 02 or 03, capture a baseline at t = 2 s, and write your prediction. Change one slider, then compare at the same time.
Notes stay in this page’s memory. Reset or reload clears them.
Geometry supplies points and triangles. More segments let a wave bend smoothly; the shader does not create extra vertices.
The vertex shader computes a height from x, z and time. A uniform is one value supplied from JavaScript to the whole draw.
y = A · sin(k · x − s · t)The fragment shader combines the surface normal, light and viewing direction. Pale crests are a color mask, not simulated bubbles.
This is a small procedural wave model with approximate lighting. It does not solve ocean physics, breaking waves, buoyancy or physically based rendering.
Next: implement three short exercises →