/ghibli-threejs:threejs-night-lights-lanternsfrom ghibli-threejs
Adds warm night lighting to three.js scenes: floating paper lanterns, fireflies, moths, lotus, river mist, oil lamps, and a boat-bow lantern that swings as a damped pendulum. Uses InstancedMesh, canvas text atlas, and a single real point light pattern to avoid shader recompiles.
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 first night pass is usually correct but murky: all cool blue, nothing leading the eye. Warm
pockets fix it — lanterns drifting with the current carrying lines of text, a lamp beside the
focal character, fireflies along the banks, a lantern swinging on a boat. Everything fades with
the night blend k and costs one draw call per system.
Stack: three.js WebGLRenderer (vanilla or R3F), MeshStandardMaterial patched with
onBeforeCompile, ShaderMaterial Points, a bloom pass. Assumes a night blend k exists
(threejs-ghibli-night-mode).
Add warm pockets and life to the night of
{{entry file}}:
{{n, e.g. 9}}floating paper lanterns drifting with the current: one InstancedMesh for the paper, one for the wooden frame; each lantern reads its own cell of a canvas atlas through anaCellinstance attribute patched into the UV varyings; the paper texture is bothmapandemissiveMapso the handwriting stays dark on glowing paper. Write one line of{{user text source}}per lantern and redraw the atlas when it changes.- A small oil lamp beside
{{focal character}}with the only extra real light.- ~110 fireflies (one
Points, wander by summed sines,pow(sin, 4)blinks, never in sync), lily pads with a few faintly glowing lotus, and a very faint low mist masked to the river.- Hang a
{{paper lantern}}with{{word, e.g. 河畔}}brushed down it from a bent{{bamboo}}pole at the bow of{{boat}}. Keep it plumb in the world and swing it as a damped pendulum from the boat's acceleration and rocking. By day it is unlit paper; at night the paper glows and one point light (created at intensity 0 so night never recompiles) lights{{character}}and the water. Everything fades with the night blend. Screenshot at night from eye level and from above.
PointLight at build time with intensity 0 and raise it with k. Adding
a light when night is toggled changes the light count and recompiles every patched material on
that frame.references/fireflies-and-lights.js.PlaneGeometry panels merged, each showing the whole cell so the line reads from
every side. aCell = (col, rows−1−row); in the vertex shader after <uv_vertex>:
vMapUv = (uv + aCell)/vec2(COLS, ROWS); vEmissiveMapUv = vMapUv;.document.fonts.load(font) then redraw). Build the canvas font
stack per language: list a CJK web font behind the Latin hand only when the text needs it.0xffa94d): just over night's bloom threshold, so it
glows without flattening the text. Per-lantern flicker from instanceMatrix[3].xz as a seed..0016 m) and as emissive
modulation (thinner creases glow brighter) plus a hot spot where the candle sits.keepAlbedo so night white-dimming skips them.references/lantern-atlas.js.Points: spawn mostly along the banks, a few over the water, 0.25–1.65 m up.
Wander by summed sines in the vertex shader; blink pow(max(0, sin(t·(.6 + seed·.8) + seed·50)), 4)
so they are never in sync. Colour 0xd6ff72, peak ~1.25 linear (a small soft bloom each),
~7 px at 8 m, min 2 px.30/-mv.z) and a
higher floor (.25 + blink)..55 + .45|sin(37t)|, night only..07 r⁴) and faintly wavy;
veins (~18), midrib and a reddish rim painted in the shader from vLocal. Pads/lotus/buds float
on the shared wave-height function (y only).0xff7fb4 × ~0.5 × k. Keep the lathe's own smooth normals —
computeVertexNormals() on non-indexed geometry gives flat facets.smoothstep(.5, .82, fbm) × riverMask × nearFade × farFade × ~0.1 × k, the river-centre formula re-implemented in GLSL. Put them in
the AO-hidden list.Fount, burner gallery, wick knob, bellied chimney (fresnel-rimmed transparent glass, emissive
warms only slightly), four wire guards as TubeGeometry along Catmull-Rom arcs, vented cap, bail.
The flame is an additive lathe teardrop: blue at the wick, a white-gold core by the view-facing
term pow(N·V, 1.5), orange skirts, swaying and stretching on the same beat as the light's
flicker (.9 + .06 sin(9.1t) + .04 sin(23.7t + 1.3)). Light: 0xffa050, ~2.4 cd, distance 6.
Ribbed lathe (r = .085 sin(π(.12 + .76t))·(1 + .04 cos(14πt))) between black caps on a short
cord; paper emissive 0xffa050 × ~2.2 × k with a slow flicker. Collect all glow materials in one
list stepped with k.
Parent a pivot to the hull at the pole tip and each frame set
pivot.quaternion = inverse(hullWorldQuat) × swing(ax, az). Drive the swing with a spring
(ω ≈ 6.5, damping ≈ 1.6) toward −acceleration/g plus a slow sine for wind; clamp ±0.5 rad.
Paper is a lathe with a 1024×512 canvas texture (washi gradient, rib lines, vermilion end bands and a
word brushed vertically in a brush font) as both map and emissiveMap, so the ink reads dark on the
lit paper. Put the word's copies on the lathe's diagonals (u = .125, .375, .625, .875), since u = 0 faces +Z
and .25 faces +X. Paint first with a system fallback font, and load the brush web font only once the scene is
ready, then repaint. Move the shared, pre-created point light to just under the paper each
frame. Code: references/boat-lantern-pendulum.js.
NaN; NaN survives every later frame and hides the mesh. Default inputs to 0 and reset the
state when it isn't finite.document.fonts.load() until the
scene is ready. A CJK web font listed as a fallback in every canvas font string cost ~200 KB per visit even for
Latin text: text drawn before the first font lands falls through to it, fonts.load() loads every family in
the stack, and the sliced CJK font carries ASCII in most slices.threejs-ghibli-night-mode · threejs-boat-buoyancy-steering · threejs-postprocessing-anime-grade ·
threejs-webgl-performance-profiling · threejs-stylized-rock-material · threejs-webgl-realistic-water
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
threejs, night-lighting, lanterns, fireflies, point-lights, instanced-mesh
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.