/ghibli-threejs:threejs-gpu-butterfliesfrom ghibli-threejs
Adds GPU-instanced butterflies to a three.js meadow with flight, wing animation, and resting behavior computed entirely in the vertex shader — no per-frame CPU cost. Use when a nature scene feels static or you need cheap ambient insects.
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 flower meadow with wind in it still reads as a painting until something small crosses it on its own business. Eighteen butterflies do that for one draw call and one shader program, with nothing updated per frame on the CPU: position, heading and wing beat are all functions of time and a per-instance seed.
Stack: three.js InstancedBufferGeometry + ShaderMaterial (r150+), a shared uTime uniform. Works in R3F as a
<mesh> with the same geometry and material; no useFrame needed beyond the one that advances uTime.
Add
{{count: ~18, 8 on low-end devices}}butterflies over{{the flower meadow}}in{{entry file}}as a single instanced mesh flown in the vertex shader: each has a home on a flower (collect positions while scattering the flowers), wanders within 1–2.6 m of it on two summed slow sine loops with a bobbing height, faces along its own path, beats its wings quickly in flight and comes down to rest on the flower now and then, fanning them slowly. Paint the wing in the fragment shader (two ellipses for fore and hind wing, dark border, pale dots, faint veins) in{{4–5 tints}}. Fade them out at night and in rain, hide them from the ambient occlusion and depth pre-passes, and cast no shadows.
references/butterflies.js)uv.y = root → tip), and a thin dark body quad flagged with uv.x = -1.aHome (xyz + seed in w), aTint (rgb). Homes are flower positions + 0.26–0.36 m, picked
from flowers within 17 m of where the visitor stands.t = uTime·(.8 + .4·fract(s·3.7)) + s·50 — different speeds and phases, so no two are in step.path(t, s): radius R = 1.1 + 1.5·fract(s·7.31); x/z are two summed sines at unrelated rates
(.23 & .71, .19 & .63); height .5 + .32·sin(.37t) + .05·sin(6.3t) — the fast term is the bob.
A little uWind drift on top.rest = smoothstep(.5, .86, sin(t·.13 + s·40)); mix(path, vec3(0), rest) brings it down onto the
home flower for a few seconds every ~48 s, each on its own schedule.d = path(t + .12) − path(t), yaw = atan(d.z, d.x). No stored velocity.a = mix(.2 + 1.05·sin(uTime·(11 + 4s)), .95 + .4·sin(uTime·1.7), rest); both wings lift
about the body line: p = vec3(p.x, |p.z|·sin a, p.z·cos a). Then rotate by yaw and add home + path.uShow scales the whole insect; ease it toward (1 − night)·(1 − min(1, rain·3)) and hide the mesh under .02.discard outside. Opaque + discard means depth writes and no sorting.margin = smoothstep(-.17, -.03, d) darkens toward the edge to 22 % of the tint; pale dots ride the border;
faint veins from sin(atan(p.x, p.y)·26); a lighter patch near the body.col · (.8 + .2·cos a) so the wing flickers as it beats. In an HDR composer this needs no tone-mapping
include.rest makes the phase jump
whenever rest changes; mix the results of a fast sine and a slow sine instead.frustumCulled = false — the geometry's bounds are a 10 cm quad at the origin.-.3 … -.06) with white wings reads as a grey blob at distance; keep the border thin.renderer.info: +1 draw call, +1 program. No dark speck at the world origin with AO on.references/butterflies.js — geometry, instanced attributes, both shaders, and the show/hide step.threejs-procedural-vegetation (the flowers they live on) · threejs-night-lights-lanterns (fireflies take over at night) · threejs-webgl-rain-effect · threejs-fish-school-boids · threejs-postprocessing-anime-grade
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
threejs, gpu-instancing, vertex-shader, butterflies, ambient-life, nature-scene
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.