/ghibli-threejs:threejs-glb-realism-pipelinefrom ghibli-threejs
Takes an existing Blender scene or GLB and transforms it into a photorealistic three.js/WebGL scene through a structured pipeline: Blender realism pass (scale, bevels, PBR, lightmaps), GLB optimization, WebGL viewer with HDRI/AgX/GTAO/bloom/SMAA, automated Playwright screenshots, and visual critique loop.
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; scripts run unread.
Realism in real-time 3D comes mostly from light and surface response, not from polygon count. This skill applies the techniques in a fixed order (scale → geometry → materials → baked light → viewer → post) and then looks at the result through screenshots instead of guessing from code.
Everything for a model goes in realism/ next to the source file:
realism/
config.json # texture mapping + pass settings (copy from references/config.example.json)
build/scene.glb # output of the Blender pass
build/scene.opt.glb # optimized output (what the viewer loads)
shots/iter-N/*.png # screenshots per iteration
critique-log.md # running history of scores and fixes
SKILL_DIR below means the directory this SKILL.md lives in.
One-time setup (skip if SKILL_DIR/scripts/node_modules exists and contains draco3dgltf):
cd SKILL_DIR/scripts && npm install && npx playwright install chromium
Blender 4.x must be on PATH as blender. The viewer loads three.js r170 from cdn.jsdelivr.net, so it needs internet access.
node SKILL_DIR/scripts/inspect_glb.mjs path/to/model.glb
(For a .blend file, skip to step 2, which accepts .blend directly, then inspect its output.)
A model that already ships for the web with Draco geometry and WebP textures works as input: the inspector registers the Draco and meshopt decoders (so it also reads step 3's output), Blender's glTF importer reads Draco and WebP (checked on Blender 5.2), and the viewer loads both. A script that reads a GLB's accessors by hand will not.
Read the report for: bounding size in meters (a warehouse should be tens of meters, a pallet ~1.2 m; anything wildly off means a scale fix), meshes without UVs, materials without textures, and triangle count. Write down the problems before changing anything.
blender -b --factory-startup --python SKILL_DIR/scripts/blender_realism_pass.py -- \
--input path/to/model.glb --output realism/build/scene.glb --config realism/config.json
The config controls each stage, so you can turn them on one at a time and compare:
scale: multiplier to reach real meters.bevel: small chamfer on hard edges so they catch highlights (width ~0.005–0.02 m).textures: maps material-name patterns to PBR texture folders (Poly Haven / ambientCG downloads). Objects without UVs get box-projected UVs at real-world scale.bake: Cycles bakes direct and indirect diffuse light into a second UV set ("Lightmap") and exports it through the glTF occlusion slot. The viewer promotes it to a true lightmap. This step is what gives soft bounce light and contact darkening. It is slow, so start at 512 px / 64 samples and raise only for the final version.lights: "auto" adds a sun and sky for baking when the scene has no lights. For an indoor warehouse, prefer the scene's own ceiling lights (area lights or emissive panels).Read references/realism-checklist.md when deciding values, since it lists the numbers that work for industrial and architectural scenes.
bash SKILL_DIR/scripts/optimize.sh realism/build/scene.glb realism/build/scene.opt.glb
node SKILL_DIR/scripts/screenshot.mjs --root . --model realism/build/scene.opt.glb \
--out realism/shots/iter-1 [--hdri path/to/studio.hdr] [--params "exposure=1.1&weather=0.6"]
This serves scripts/viewer/index.html and renders fixed camera views (overview, eye-level, aisle, close-up) so every iteration compares the same angles.
For interactive tuning, run the same script with --serve. It prints a URL, and the viewer has a GUI panel (exposure, lightmap intensity, AO, bloom, weathering, sun). Copy good values back into --params.
Open every screenshot in the iteration folder (use the Read/view tool on each PNG; look at them, don't skip). If the user gave a reference photo, compare side by side. Score using references/critique-rubric.md and append the result to realism/critique-log.md in the format specified there.
The critique must end in at most 3 fixes, each mapped to a concrete knob (a config key, a viewer param, or a Blender change). Vague fixes like "improve lighting" are not actionable. A fix reads like "floor has no variation → set weather=0.7 and map *floor* to ambientCG Concrete034".
Apply the fixes, rerun from the earliest affected step, screenshot into iter-N+1, and critique again. Stop when the overall score stops improving by more than ~0.5 between iterations, or when the user is satisfied. Tell the user the score trend and show the before/after shots of the same view.
realism/.critique-log.md.references/realism-checklist.md: the techniques with recommended values. Read before choosing pass settings.references/critique-rubric.md: scoring categories and log format. Read before every critique.references/prompts.md: ready-made prompts the user can give Claude Code to drive this skill.references/config.example.json: starting config.references/config.example.json (opens in a new tab)references/critique-rubric.md (opens in a new tab)references/prompts.md (opens in a new tab)references/realism-checklist.md (opens in a new tab)scripts/blender_realism_pass.py (opens in a new tab)scripts/inspect_glb.mjs (opens in a new tab)scripts/optimize.sh (opens in a new tab)scripts/package.json (opens in a new tab)scripts/screenshot.mjs (opens in a new tab)scripts/viewer/index.html (opens in a new tab)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.