/ghibli-threejs:threejs-ghibli-night-modefrom ghibli-threejs
Transforms a three.js day scene into a Studio Ghibli-style night with a painted sky, moon, stars, Milky Way, shooting star, moonlit water, bioluminescent fish, and purple shadows via a single applyNight(k) cross-fade.
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.
Produces a bright, vibrant anime night (never black): a deep indigo zenith fading to a cool teal horizon, a big painted moon whose glint path runs down the water, stars the water reflects, and warm/cool accents that give the eye a focal point.
Stack: three.js WebGLRenderer + EffectComposer (vanilla or React Three Fiber), sky as a
ShaderMaterial dome, other materials patched through onBeforeCompile. Assumes a day scene
already exists (see Related skills): a painted sky shader, a directional sun that every shader
reads, water with refraction/reflection, and a grade pass.
Core idea: night is a blend factor k (0 = day, 1 = night), not a second scene. One
applyNight(k) lerps every live value from the day state toward night constants, and is called
from the same place the sun update runs. The toggle, the tune panel and any day cycle all go
through it, so the day look keeps working and every night value is one lerp away from day.
Enhance the visual effects of the three.js scene in
{{entry file, e.g. index.html}}to transition it into a Studio Ghibli-style night scene. The aesthetic target is{{reference image path}}— {{style: e.g. "painterly indigo night sky, luminous moon, twinkling stars, and deep moonlit water"}}.Keep every tunable as a named constant at the top of the script and expose them in a lil-gui "Night Tune" panel. Implement night as a blend factor
k(0 = day, 1 = night) driven by a☾ Nighttoggle that cross-fades over{{~4}}s: write oneapplyNight(k)that lerps every live value from the day state toward the night constants, and call it from the same place the sun update runs so sliders, the day cycle and the toggle all go through it. After each section, screenshot close-up, eye-level and max-zoom-out views. Verify the visibility of the fish and the water reflections before moving on.
- Painterly night sky (extend, don't replace, the day sky), a painted moon with a halo, stars as
THREE.Pointswith twinkle; retarget the directional light to the moon.- Moonlit water: a reflection floor, dimmed refraction, blue-shifted absorption, silver glints at roughness ~0.2, soft ghost-blue caustics.
- Fish: wet clearcoat, bioluminescent pattern spots and fin tips, a ghost/silver variety, glowing ripple crests.
- Night lighting and a cool grade; dim white albedos and the environment map.
- A brighter night with a focal point: night exposure, a storybook moon, Milky Way, hero stars, a shooting star,
{{warm pockets, e.g. paper lanterns / an oil lamp}}.
Extend the sky ShaderMaterial — the day sky is still needed at k = 0 — and end with
mix(dayColour, nightColour, uNight). Full shader: references/night-sky.glsl.
0x1a1e5e (deep indigo), mid 0x2f4c94 (a Ghibli night is
bright blue), horizon 0x3f8a98 (teal, light enough for the treeline to read as a silhouette).
The same haze band ramps into the dark-blue terrain fog (0x172642, FogExp2 ≈ 0.012).muv = (d·mx, d·my)/size),
paint mottled maria with 2D fbm, a gentle limb falloff and a soft-edged disc. Keep the disc's
linear value ≈ 0.8–1.0 (white after ACES × exposure but under the bloom threshold, so the
maria survive). A separate warm-silver halo (exp(-ang²/w²)·.5 + exp(-ang/(3.5w))·.14) carries
the glow into bloom. Storybook size: angular radius ~0.088 rad (~10° across), halo width
scaled with the disc, plus a glowing rim hugging the limb: exp(-((ang − size)/(size·.16))²).0xc9d6ff).
Every sun-driven shader (halo, clouds, toon ramp, caustics, water glints) follows for free.max(el, 10°) so the world is never
lit from under the horizon. Keep calling applySun after the fade until the climb ends. Any
path into night (button, tour) gets the rise for free.THREE.Points on the sky sphere (R ≈ 470) with a per-star attribute
(size px, brightness, twinkle phase): ~2600 static dim background stars, ~700 twinkling
foreground stars (.55 + .45 sin(t·1.6 + phase + dot(pos, k))). Clamp gl_PointSize ≥ ~2.4 px
and let a soft circular alpha carry the rest. Put them on a layer the refraction camera doesn't
render and hide them for the GTAO pass only — but leave them visible to the mirror camera so
the water reflects them. Code: references/stars.js.exp(-d²/w²) around one great circle (w ≈ 0.13), brushed with fbm and split by
a dark rift, ~0.075 linear, plus ~900 extra faint stars packed into the band.Points layer, ~15 px, with a four-point sparkle (thin cross
spikes + core + halo), core ~0.7 so bloom only kisses them.F = max(F, uReflMin) with ~0.22–0.30 at night.
From above, Fresnel alone gives 2–3 % and the water becomes a black hole.uRefrDim ≈ 0.65–0.78. Below ~0.5 the
fish disappear.(1.9, 1.1, 0.42)/m (× ~0.7 for clearer water) and a dark-blue
in-scatter (0x0b1e3a).directSpecular already takes the light colour, so it turns silver by itself.
Lerp roughness toward 0.2 and glint gain to ~0.55–0.7.mix(c, sqrt(c)*.5, uCausticSoft) (~0.7) softens the web into a pale wash, tinted
ghost-blue (0x8fb8ff); the caustic UV follows the light vector so they drift with the moon.mask × colour × (.55 + .45 sin(t·speed + phase)) to
totalEmissiveRadiance (orange 0xff7a30, speed ~1.3 rad/s). On fins, use the root→tip weight
in the vertex data for pale-cyan tips (0x6cf2ff). One shared uBio uniform × k.gCrest = max(gCrest, env × amp)) and add paleBlue × gCrest × ~0.9 (1.4+ reads as a neon hoop).0x1e2a66 at
0.75 contributes almost nothing; use mid-blues (0x4a5cb0 / 0x54407a at ~0.6–0.75), ambient
0x3a4c86 at ~0.55, and a purple shadow fill.0x62e0f0), rim → moon-blue; the banded ramp needs no change.mid = 1 − sh − hi), highlights → silver, saturation up (~1.28). Bloom
threshold 0.85 linear, strength ~0.6.MeshStandardMaterial colours (luminance > ~0.5) by
~0.4, weighted by smoothstep(lum, .45, .85). Collect once after loading; skip vertex- and
instance-coloured materials and shader-coloured ones.A first pass usually comes out murky. Fix it in this order:
renderer.toneMappingExposure = lerp(dayExposure ~0.9, NIGHT_EXPOSURE ~1.15, k)
inside applyNight, so the panel's exposure slider must go through applyNight too. Exposure is
applied after bloom, so it lifts the frame without new blooms — but lower the moon disc to ~0.8
at the same time or it clips.threejs-night-lights-lanterns.Structure of applyNight / stepNight: references/apply-night.js.
PointLight when night is toggled recompiles every patched material on that frame.smoothstep(.5, .82, fbm) reads as wisps.0xa3aed6) and the moon
glow narrow (pow(nearMoon, 24)).applyNight returns early at k = 0 when it wasn't night last frame,
so the day panel keeps its edits. Therefore never write x *= factor inside it — write
absolute values from a stored base, or values compound every frame.k = 0 / k = 1) to check end states; don't trust a fade in a background tab
(requestAnimationFrame throttles to ~1 fps and screenshots are stale). Check
document.visibilityState and that the time uniform advances.threejs-ghibli-sky-clouds · threejs-webgl-realistic-water · threejs-fish-school-boids ·
threejs-night-lights-lanterns · threejs-day-cycle-lighting · threejs-postprocessing-anime-grade ·
threejs-ghibli-toon-shading · threejs-camera-guided-tour · threejs-headless-visual-verification
What SKILL.md sets; muted values are Claude Code's defaults
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.