/ghibli-threejs:threejs-webgl-waterfall-effectfrom ghibli-threejs
Builds a stylised-realistic waterfall in three.js WebGL with layered parabolic sheets, spray billboards, rainbow, ballistic droplets, and plunge basin effects. Use when the user wants a waterfall, cascade, or spray/mist in a three.js / R3F scene.
Ships in ghibli-threejs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A waterfall that reads from far away and close up: water tipping glassy over an overhanging lip,
turning white and streaky as it accelerates, tearing into spray where it strikes a plunge basin
it has dug into the cliff's foot; a dark wet rock face behind it; spray puffs boiling up with a
faint rainbow when the sun is behind you; droplets thrown out; rings and froth running across the
pool. Everything is procedural geometry + ShaderMaterial/patched MeshStandardMaterial in a
three.js WebGLRenderer scene with a terrain height function and a water SDF (see
threejs-open-world-streaming) and water from threejs-webgl-realistic-water.
A waterfall in
{{scene}}that pours off the cliff's true lip into a plunge basin cut into its foot:
- a wet rock face behind it;
- three sheet layers on a parabola, glassy at the lip, white and aerated below, tearing into spray at the foot;
- thin side threads;
- rising spray puffs that fade at the water, with a rainbow at 42° from the antisolar point;
- ballistic droplets;
- rings and froth on the water;
- boulders at the foot.
Check the geometry numerically before shading: print a height grid round the site, find the real lip, and confirm the sheet's foot lands in water. Syntax-check the module with
node --checkbefore every reload.
d = smin(d, hypot((x − px)·0.8, z − pz) − r, 1.5)), and multiply the cliff term in
terrainHeight by smooth(−0.3, 2.4, dPlunge) so the cliff is notched steeply round it. The water
plane already exists everywhere under the terrain, so carving the terrain is enough.h(z − .4) − h(z) ≤ .12). The first version sampled the lower slope: the fall came out 3.6 m
tall, started in mid-air, and its foam disc was buried under the terrain.For each (angle a ∈ ±1.8 rad, height y) bisect along a ray from the basin centre to where the ground
reaches that height (24 steps); if it never does, tuck the vertex underground. Then pull the vertex
out by relief (.16 + .42n + .16n2 + .26·ledge, ledges fract(y·.62 + n)³, seams), add an
overhanging roll just under the lip (.55·exp(−(a/.3)²)), and push it back into the turf at the sides
and top so it emerges rather than ending in a hard panel. Vertex COLOR_0 with moss in alpha.
Reuse the rocks' shader (threejs-stylized-rock-material) and inject extra wetness by
string-replacing its rain term: uRain*.85) → max(uRain*.85, cliffWet(vWPos))); soaked rock goes
dark ×(.5, .58, .56), dry rock gets long vertical stains.
Grid 10 × 44 (+3 rows of "tongue" sliding to the lip along the ground). Row v ∈ 0..1:
y = top − v·(top − yBot), z = lip.z + zOff + throw·√v + bow·(1 − (2u−1)²)·(.25 + .75v)
(out ∝ √drop — a parabola), width widening × (1 + v·spread).
Layers [width×, zOff, spread, bow, [speed, alpha, streak density, seed]]:
back [1.14, −.22, .36, .12], main [1, 0, .28, .24], front [.78, .15, .2, .3]. Two thin threads
either side at ±(W/2 + 1.1) falling onto catch-stones.
Fragment: streak coordinate f = √v·k − t·speed so streaks stretch as the water accelerates;
aer = smoothstep(0, .2, v) (glassy → aerated); frayed edges that widen with aeration; alpha tears
into spray over the last 22%; a bright roll at v ≈ 0.012
(.45·exp(−((v − .012)/.014)²)); colour teal-glass → white. transparent, depthWrite: false,
DoubleSide, fog on. See references/waterfall-sheet.js.
30 instanced view-facing puffs born at the strike, swelling (.8 + 3ph) and rising (ph²·5.5) as they
drift out, fading in/out over their life.
world y = c.y + (viewMatrix[1][0]·x + viewMatrix[1][1]·y)·size. This removes the hard line where a
puff crosses the water plane.θ = acos(dot(viewDir, −sunDir)), band 40.7–42.4° (k = (θ − .706)/.036), hue violet
(inner) → red (outer), only by day and with the sun above the horizon. Let it raise the puff's
alpha as well as its colour (a·(.17 + .3·bow)), or it vanishes at spray opacities.
Test by setting a low sun behind the camera for one frame.p = origin + v0·t − (0, 4.2t², 0), life 0.7–1.5 s, sized in metres
(gl_PointSize = size·uPx/−mv.z, uPx = drawingBufferHeight/(2·tan(fov/2))), culled below water.uFall = (x, z, halfWidth, on) uniform; rings run out from the strike line
(sin(L·6.5 − t·5.2 + noise)·exp(−L·.3)), churn noise exp(−L²·.9), froth
smoothstep(.3, .85, (exp(−L·.6) + .4·churn)·(.4 + .95n))·.9.Math.exp(-(a/.3)**2) is a SyntaxError (a unary minus before **) and the whole module fails
— write Math.exp(-((a/.3)**2)). Run node --check on the extracted module before every reload.// comment dropped mid-line in a one-line function silently comments out the rest.threejs-webgl-realistic-water · threejs-stylized-rock-material · threejs-open-world-streaming
· threejs-postprocessing-anime-grade · threejs-headless-visual-verification · threejs-day-cycle-lighting
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub nicksonthc/ghibli-threejs --plugin ghibli-threejs31 skills in this plugin
/threejs-blender-glb-pipelineBuilds a reference-image-driven asset pipeline from headless Blender to GLB for a three.js scene — an asset contract (units, axes, grounding, required mesh/material names, budgets, attachment numbers), one parallel subagent per asset group writing craft_<slug>.py generators, preview renders compared against the reference, measured-bounding-box placement in the web scene, Draco compression, and a scored asset quality pass. Use when the user has a reference picture and wants a 3D scene from it, asks to model props/trees/characters in Blender for three.js, export GLBs, fix glTF export issues (vertex-colour alpha, UV flip, axes, custom normals), compress models, or rate and improve every asset in a scene./threejs-boat-buoyancy-steeringFloats a boat (or any buoyant prop) on three.js water with Gerstner waves generated from one JS table that feeds both the GLSL vertex shader and a CPU waveHeight(), four-probe heave/pitch/roll damped springs, an arc-length drift lane that bends round rocks, click-to-steer W/A/S/D rowing with momentum and drag, an autopilot that pursues the lane back, and a chase camera that keeps the orbit. Use when the user wants a drifting or steerable boat, buoyancy, objects bobbing on waves, Gerstner waves on a river/lake, a boat autopilot, or a follow/chase camera behind a vehicle on water./threejs-camera-guided-tourBuilds a hands-free guided camera tour for a three.js scene — keyframes as data, a time-parametrised Catmull-Rom (Hermite) path with continuous velocity, one camera-owner flag, the tour driving time of day and a day→night blend, staged creatures crossing the frame, handwritten captions, portrait-phone lens widening, instant hand-back on drag/scroll/tap/Esc, and a seek() hook for screenshots and video capture. Use when adding a tour mode, cinematic flythrough, attract mode, camera path animation, keyframed camera, spline camera or showcase video capture to a WebGL scene./threejs-cinematic-loading-screenBuilds a cinematic loading gate for a three.js scene — a painted CSS dawn (layered gradients, drifting blurred mist bands, optional conic god rays, SVG feTurbulence grain, vignette), a 2D-canvas layer of falling petals and glowing motes, a handwritten title that animates in, a gold progress line with stage captions, then "tap anywhere to enter" whose tap is the browser gesture that unlocks audio; uses a still captured from the live scene as the backdrop that cross-fades into the real render, and warms up shaders before lifting so the first interaction never stalls. Use when adding a loading screen, splash screen, intro curtain, preloader, tap-to-start / audio unlock gate or shader pre-compilation to a WebGL scene./threejs-day-cycle-lightingAnimates the sun in a three.js scene from sunrise to sunset through a single applySun(az, el) writer — azimuth sweep, elevation arc, warm-to-gold light colour, horizon falloff, warming sky dome and fog, re-aimed god rays and every sun-driven shader uniform — plus a cinematic "sun follows the lens" mode that keeps the sun beside the camera heading for backlit shots with boosted god rays and forward scattering. Use when adding a day/night cycle, time-of-day slider, sunrise/sunset, moving sun, backlit tour shots, or when several systems fight over the sun direction in WebGL/R3F./threejs-dreamy-glass-hudTurns a three.js scene's DOM overlay into one coherent, dreamlike HUD — a single frosted-glass material shared by every pill, badge and popover whose colours are registered CSS properties so the whole HUD cross-fades from pearl to deep indigo as the scene turns to night; an inline-SVG icon dock whose lit toggles glow gold instead of shouting; a glass popover in place of a native select; first-visit hints "whispered" in handwriting that step aside the moment the visitor understands; a HUD that drifts away after half a minute of stillness; a mote of light under each tap; a staggered arrival after the loading gate; and letterbox bars during a camera tour. Use when the overlay UI looks like a dev panel on top of a beautiful scene, when asked for a dreamy, cinematic, premium or 梦幻 / 绝美 UI, glassmorphism, a day/night-aware HUD, onboarding hints, auto-hiding UI, tap feedback, or to restyle lil-gui to match.