Visual Effects Guide
This is the entry point for the visual-effects plugin. Pick the skill for the
situation, then follow one of the workflows if the job has several parts. Each
skill owns one layer of the effect; do not let two of them own the same output.
Pick the skill
| Situation | Skill | Why |
|---|
| Fireballs, fire waves, burning ground, smoke columns, embers in Three.js | fire-smoke-vfx | One shared fire module with held flames, flame walls, smoke fronts, sparks and an impact frame |
| Shader code: ray marching, SDF, fluid or ink, procedural noise, WebGL2 pages | glsl-shaders | ShaderToy-style GLSL techniques with WebGL2 adaptation rules and a shader debugging table |
| Glow or halo around bright lights in a Three.js WebGPU/TSL scene | threejs-bloom | Scene-linear HDR bloom with full-scene, selective or hybrid input and performance gates |
| Sparks, debris, ribbon trails, wakes, dissolving particles in Three.js WebGPU | threejs-particles-trails-and-effects | Chooses the motion and pool representation before the visuals, with HDR and depth ownership |
| Rigid bodies, colliders, gravity, Rapier world in Three.js | threejs-physics | Fixed timestep, collider choice, render synchronisation and teardown for a physics engine |
| Fluid, smoke, fire, cloth, rigid or hair simulation baked in Blender | blender-simulation-workflow | Treats a sim as a cache-producing build step with preview, bake and validation gates |
Workflows
1. Hero fire moment in the browser. (fire-smoke-vfx, then threejs-bloom)
- Input: THREE, renderer, scene and camera; the beat list (a held flame, a throw, a hit).
- fire-smoke-vfx: copy
assets/fire-fx.mjs, call createFireFX, warmup() before the first hit, then drive each beat with flame, flameArc, flash, sparks and impact. Output: a frame loop that calls update(realDt) and render().
- threejs-bloom: applies only to a WebGPU/TSL scene, and the fire module is a WebGL2 build on Three.js r170. Keep the fire module's own Dual-Kawase bloom and do not add a second bloom pass on top of it.
2. Seeded particle effect with a glow. (threejs-particles-trails-and-effects, then threejs-bloom)
- Input: the event interval, a deterministic seed, the coordinate frame and the lifetime clock.
- threejs-particles-trails-and-effects: write the effect contract, pick the least writable state (analytic for pure functions of time, recurrent for collision feedback), then bind depth and output. Output: a seeded fixed-time capture with pool counts, bounds and draw timing.
- threejs-bloom: consumes the HDR emission from the previous step. Output: the bloom-off and bloom-on captures at fixed times, with the bloom-off view still readable.
3. Physics-driven debris with a presentation pool. (threejs-physics, then threejs-particles-trails-and-effects)
- Input: the body list, collider shapes, units in metres, gravity direction, the fixed timestep.
- threejs-physics: initialise the engine, set units and gravity, step on a fixed timestep with a bounded accumulator, and interpolate poses for rendering. Output: body poses per render frame.
- threejs-particles-trails-and-effects: the debris pool consumes those poses as an external producer. Record the quantity, frame and origin, and whether the pool is presentation-only or backed by a physical body. Output: a debris pool that never writes back into the physics world.
4. Offline simulation handed to a render. (blender-simulation-workflow)
- Input: the simulation type, the scale in metres, the domain bounds, the emitters and colliders, the critical frames.
- blender-simulation-workflow: write the contract, bake a short coarse preview, inspect the critical frames from two cameras, change one causal group at a time, then bake final data. Output: the setup script or .blend, a cache manifest and inspected evidence. Rendering the approved frames is handed to a separate rendering skill that this plugin does not include.
Hand-offs between skills
- Fire and smoke hands lightning and energy work to
lightning-energy-skill-vfx, and names create-game-vfx for readable, budgeted gameplay effects, whose readability rules still apply (fire-smoke-vfx, opening section).
- A particle pool that consumes collision or forces from another system closes the handoff first: quantity and units, frame, transform revision, sample phase and the reset rule (threejs-particles-trails-and-effects, "coupled inputs" preamble).
- A physics body that drives visuals stays the source of truth; the pool reads its published poses (threejs-physics, "Move kinematic bodies through engine APIs").
- A baked Blender cache is the input to a render, and the render step belongs to the rendering skill named in blender-simulation-workflow.
Before you call it done
- Bloom-off capture taken and readable, with the bloom path enabled only after that check (threejs-bloom, step 1; threejs-particles-trails-and-effects, step 6).
- Physics tested at the highest expected velocity, at low frame rate, after tab resume and after repeated resets (threejs-physics, "Release world objects" paragraph).
- Blender deliverables present: setup script or .blend, cache manifest, final cache, and inspected evidence (blender-simulation-workflow, completion gate).
- Shader compiles in WebGL2 with the version line first, the mainImage wrapper, and loops inside the stated budget (glsl-shaders, "WebGL2 Adaptation Rules" and "Performance Budget").
- Fire beats eased: sizes and intensities go through their own curves, and nothing pops on a beat change (fire-smoke-vfx, "Between beats, ease").
Pro habits
- Treat a simulation as a cache build. Bake a preview first and the final last (blender-simulation-workflow, "Bake and validate").
- Judge the cache across frames, not one frame. Inspect onset, peak and settle frames from at least two cameras (blender-simulation-workflow, step 1 of "Bake and validate").
- Set real-world scale before tuning. Record units and apply scale so colliders and domains are not mis-sized (blender-simulation-workflow, "Build a controlled setup"; threejs-physics, "Establish units").
- Step physics on a fixed timestep with a bounded accumulator. Cap substeps and decide what happens after a stall (threejs-physics, second paragraph).
- Choose the least writable state. Use analytic evaluation when pose depends only on spawn data and time (threejs-particles-trails-and-effects, step 2 table).
- Give every visible or physical claim one owner. Name the HDR signal, the tone-map owner and the output conversion (threejs-bloom, step 5; threejs-particles-trails-and-effects, step 1).
- Keep the bloom-off image legible. Judge silhouette and motion without bloom before adding glow (threejs-bloom, step 1; threejs-particles-trails-and-effects, step 6).
- Band-limit detail and advect noise. Fade each octave by its size in buffer pixels, and move noise with buoyancy rather than scrolling it (fire-smoke-vfx, "The layers" table and rules).
- Measure against the target before tuning by eye. Compare mean colour in fixed regions against the reference (fire-smoke-vfx, "Ground, light and frame" rules).
- Give each feature its own random stream and keep approved seeds. Never change a seed to tidy a layout once it is approved (fire-smoke-vfx, "Randomness and layout").
Amateur tells
- A plausible single frame accepted as a finished sim. Bake a preview, inspect the critical frames, then keep a manifest (blender-simulation-workflow).
- A fluid modifier taken for a bake. Check that the evaluated domain mesh is nonempty and changing across frames (blender-simulation-workflow, step 4 of "Bake and validate").
- An approved cache overwritten. Write to a new location or get explicit approval first (blender-simulation-workflow, "Define the simulation contract").
- A visual mesh used as a dynamic collider. Use primitive or compound colliders and check the engine's rules for triangle meshes and hulls (threejs-physics, third paragraph).
- Additive smoke that looks like grey haze. Use premultiplied over, not additive (fire-smoke-vfx, "Smoke" rules).
- Round billows on a flame front. Use a thin streaked curtain for a front and keep billows for a burst or column (fire-smoke-vfx, "Smoke puffs read as floating boulders").
- A
fract(sin(x) * 43758) hash on Metal. Replace it with an arithmetic hash (fire-smoke-vfx, "Randomness and layout"). The glsl-shaders particle-system template uses the sin form, so swap it in the same way for a Metal target.
- Glow added on top of a glow. Name one bloom owner in the graph (threejs-bloom, step 5).
When not to use this plugin
- Lightning, energy orbs and black afterimage smoke: the fire skill names
lightning-energy-skill-vfx for these, and that skill is not in this plugin.
- Sky, atmosphere and depth haze in Three.js: use the 3d-scenes plugin's
threejs-sky-atmosphere-and-haze skill.
- A 2D canvas or CSS glow with no Three.js scene: none of the bloom steps apply, because they need scene-linear HDR.
- Writing, script or sound design for a video that uses these effects: use the scriptwriting or sound-design plugins instead.