/ghibli-threejs:threejs-procedural-vegetationfrom ghibli-threejs
Generates and scatters storybook-scale vegetation in three.js using InstancedMesh, including trees, grass, flowers, shrubs, bamboo, and rice paddies with wind, shadows, and LOD.
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 Ghibli meadow is dense, deep green and slightly oversized: blades and leaves big enough to read at 10 m, shrubs that rise out of the grass, trees whose crowns read as one mass, flowers with painted eyes, petals drifting from sakura. This skill covers how to generate, instance, cull and shade that vegetation without blowing the triangle budget.
Stack: three.js WebGLRenderer (r186), vanilla or R3F; InstancedMesh per (geometry, material, spatial cell); shading via the patch() helper from threejs-ghibli-toon-shading (wind, puff normals, SSS, flecks) with matching customDepthMaterials. Seeded RNG (mulberry32) everywhere so layouts are deterministic.
Using
{{reference image}}, revise the vegetation of{{entry file}}: a well-spaced{{grove species, e.g. bamboo}}grove on{{left bank}},{{flowering trees, e.g. sakura}}on{{right bank}}, neat evenly spaced crafted leafy shrubs (boxwood/azalea habit, leaf cards in overlapping clumps on a dome, woody shoots at the foot, some flowering), meadow grass as folded blades in 2–5-blade tussocks, and wildflowers with shader-painted petal gradients, eye rings and veins. Everything instanced per spatial cell with wind, puff normals and matching shadow depth materials; crafted plants near the camera, painterly blobs in the haze. Keep hero objects and camera views unchanged. Screenshot the default and eye-level views against the reference and report the triangle cost.
InstancedMesh per mesh per (species, shadow group, 16–32 m cell). computeBoundingSphere() + pad (~0.4–0.5 m for wind) so frustum culling works.sparseGeometry(geo, groupSize, stride) keeps whole cards/flowers by index decimation (e.g. (…, 8, 3) past ~33 m) — no fragmented triangles.mergeVertices the icosphere before jittering (else faceted), darker underside by object-space y, leaf-fleck noise, no shadows. Grass density falls off radially (exp(-(d/11)²)), no box boundary; flowers inside noise-edged ellipses.Bark / Moss / Leaves light / Leaves dark (/ Blossom), a triangle and MB budget, ≥3 preview iterations. Every first pass came back too sparse..7·billow ellipsoid + .3·crown dome, 80 % over the card's own) and each card is wound to agree, else DoubleSide flips half the sunlit cards dark (normals_split_custom_set_from_vertices; the glTF exporter keeps them). Mirror most cards (p≈.55–.75) onto the billow's outward side..35·ellipsoid + .15·crown − .5·Z) so they shade as interior shadow. Faceted normals read as green boxes; smooth outward normals as balloons.(u, 1−v); verify by parsing the GLB.Alias the GLB, swap leaf colour for two pinks (0xf0a3bd, 0xffe6ee) mixed by object-space fbm3, keep ~10 % green, flecks off (the fleck tint turns pink orange), per-material uSssColor pink (0xffb8cc), darker greyer bark (0x6e5a55). Same instancing/wind/shadow paths.
5 culm variants in metres: tapered tube, vertex-coloured node rings with a pale band just below each node, a slight arc; leaf sprays as 4-vertex lanceolate cards drooping from upper nodes with clusterCenter = spray centre. Instances only place/yaw/scale. 56 clumps ≈ 290 culms ≈ 270k triangles. Storybook scale: 7.5–9 cm culms, 40–60 cm leaves, deeper green (real 5 cm / 25 cm vanish at 10 m). Per-instance culm tints via setColorAt from their own RNG stream. Floor: fallen blades, banded-lathe takenoko; thin grass inside clumps by zero-scaling instance matrices (the grass RNG stays unchanged).
references/shrub-geometry.js)shrubGeometry(seed, { leaves, bloom, bloomColor, hue, habit, leafL, tip }): 11–16 clumps in a (1, .8, 1) dome, ~1100 elliptic cards on each clump's outward shell (normal = outward·.75 + up·.45 + noise, tip droops 18 %), clusterCenter = clump centre, vertex colour deeper inside/underneath, yellow-green on sunny tips. ~900 triangles per shrub; 163 shrubs ≈ 150k. Habits: mound, upright vase (hydrangea: Fibonacci sphere of floret cards drifting between two colours), arching canes (yamabuki). Red new growth: lerp sunny outer leaves to a tip colour. Divide the leaf budget by the actual clump count; keep old variants' RNG streams untouched. Bank shrubs are a walk along each bank every ~3 m with jitter, not random blobs. Scale ×1.45 or they vanish in 0.6 m grass.
references/meadow-grass.js)V-folded blade (3 verts per row, midrib raised w·.45), pointed tip, computeVertexNormals; blend normal toward view-space up by ~.18 in normal_fragment_maps (at .5 the meadow goes flat pale lime). Tussocks of 2–5 blades splayed outward, lean ≤ .33 rad, width ~8.6 cm at the base (.043 × scale 0.8–1.4). Per-blade seed fract(sin(dot(instanceMatrix[3].xz, …))) → droop and a few dry tips; veins, darker foot, SSS 0xd9f07c at .3. Cost: 10 tris × 100k ≈ 1.0 M. Keep grass off the toon ramp.
instanceGLB(…, { shader: mat => options }) so Petal/Centre/Stem get their own shading. Radial coordinates without UVs: measure head centre (Centre primitive bbox) and petal reach in mesh space in JS and bake them into GLSL (vLocal is mesh space because node matrices are baked into instances); spike flowers use height instead. Eye rings, throat, veins, translucency, pincushion floret discs, darker stem foot. White rays + SSS bloom into blobs: daisy sss ≈ .22, no tip lift, ×.82 albedo, SSS colour = petal ×.8. Clumps: 1–3 blooms + buds + basal rosette, keep ~60 % of placements (~1.5× triangles), per-copy aHead attribute (xyz + scale) because shading is relative to one head point. Flowers stand ~0.6 m: look down from ~1.7 m.
Lumpy core (icosphere detail 2) + ~56 small leaf cards (core UVs pinned to an opaque leaf texel). Cut the outline in the shader: discard where 1 − |N·V| > .24 + .62·lobe(fbm3); darken clump gaps by the same noise (references/canopy-rim.glsl). Trunk: flared base + three forks, scaled (g, h, g) with g = .75 + .05h. Keep a grey copy of any tinted leaf card for instance-coloured variants (pink × yellow-green = brown).
computeVertexNormals on non-indexed = facets).clusterCenter for puff.terrainHeight, floor eased 6 cm under water with a bund; dilate wet cells one step in 4 directions within the same level; sheet 2.5 cm under the rim (dilating downhill floats a sheet over the riser). Rice hills on a 0.34 m grid.references/sakura-petals.js): gather every sakura crown into one list; twice a second hand the 8 nearest to a GPU petal system (1440 instances) that spawns in the crown, falls, drifts downwind, tumbles and lies flat once landed; plus a static carpet per crown. Petals 3.5–4.5 cm (real 1.5 cm = 3 px at 5 m). Hide from AO.u to the atlas's pale centre stripe (.45–.55).Vector3.project(camera) and hand-place a few clumps at NDC x ≈ −0.8 to frame the view.// comment pasted onto a line ending in ) comments out the paren → "missing ) after argument list". Put comments on their own line.renderer.info.render.triangles before/after; toggle species on/off in alternating cycles for fps (single runs vary ±5 fps). 26 crafted trees cost ~2 fps.threejs-ghibli-toon-shading, threejs-blender-glb-pipeline, threejs-open-world-streaming, threejs-webgl-performance-profiling, threejs-stylized-rock-material.
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.