LookLightweight
Mesh deformation
Bending and rippling an existing shape.
Bending and rippling an existing 3D shape: a sphere that breathes, a plane that waves like water, a logo that wobbles when touched. Cheap to run. The shading has to be recalculated as it moves, or it looks flat.
- Breaks when
- normals not recomputed, shading breaksCPU updates on dense meshes stall
- Also called
- vertex displacement, morph targets, wobble
Prompts
Breathing sphere
A Three.js IcosahedronGeometry(1, 64) with a vertex shader displacement: position += normal × (0.12 × fbm(position × 2.2 + uTime × 0.25) + 0.04 × sin(uTime × 3 + position.y × 6)). Recompute the normal with finite differences (offset 0.01) inside the vertex shader. MeshStandardMaterial via onBeforeCompile so lights and shadows still work. Pointer proximity adds a local bulge of 0.2 units within 0.6 units of the hit point.
Morph between two shapes
Two authored meshes with identical vertex counts and order (exported from Blender with shape keys); load the glTF with morph targets, and drive morphTargetInfluences[0] from scroll progress with a spring (stiffness 90, damping 12). Add a second influence for a subtle idle wobble. Explain why the vertex order must match.
Cloth-like plane from noise
A 120×120 PlaneGeometry, vertices displaced on the CPU each frame by two moving sine waves and a noise term, then computeVertexNormals. Show the same effect done in the vertex shader and measure both with performance.now(); print the ms per frame for each approach.
Related
Resources · 2
- The Study of Shaders with React Three FiberMaximeHeckelsite · code · demoJul 22, 2026
- three.js example: morph targetsmrdoobsite · code · demoApr 25, 2026