Reference
Parameters
MagicParams is the whole look as one JSON-safe object, apart from the effects. Presets are partial MagicParams, setParams merges into them, and getParams prints the complete set with the live effects added.
magic.params; // the current params: mutate it or use setParams
magic.setParams({ physics: { vorticity: 3 } }); // deep-merge, effects untouched
magic.getParams(); // params + effects: [{ type, options, intensity? }]Changes take effect on the next frame. Nothing eases: a new value applies at once, and the fluid responds at its own pace.
#Artist controls
params.controls holds six multipliers, all 1 by default. They're the demo's sliders.
| Key | Demo range | Multiplies |
|---|---|---|
swirl | 0 – 2 | Vorticity confinement, swirl-field spin and pull, ring confinement, force-field push, and part of the ring spin (0.6 + 0.4 · swirl) |
density | 0.2 – 3 | Rendered opacity (render.density) and the vortex-ring torus density |
buoyancy | 0 – 3 | Heat lift, 6 m/s² per unit of temperature |
dissipation | 0 – 3 | Dye fade. Glow fade uses it too, but never below 0.35 |
glow | 0 – 3 | All emission: effect and impulse glow, render.glow, render.flame, and the spell orbs' lights |
speed | 0.2 – 2 | Simulation time scale (applied after dt is clamped to 1/120 … 1/30 s) |
#Physics
| Key | Default | |
|---|---|---|
weight | 0 | Downward force per unit of smoke density: ink sinks |
damping | 0.35 | Velocity damping (1/s) |
cooling | 0.8 | Temperature decay |
vorticity | 2.2 | Vorticity-confinement gain. Keep it about 1 – 4 |
dissipation | 0.85 | Dye density fade (1/s) |
glowDissipation | 0.9 | Glow fade (1/s) |
burnRate | 3 | Fuel → heat. Dragon breath needs about 5 |
turbulence | 0.7 | Noise forcing where the fluid is hot or dense |
expansion | 0.0045 | Divergence from combustion |
sharpness | 1 | MacCormack strength for dye and state (0 = first-order, softer) |
velocitySharpness | 0 | MacCormack strength for velocity (livelier flow) |
#Render
| Key | Default | |
|---|---|---|
density | 2.6 | Extinction per unit density |
flame | 4.2 | Flame emission gain |
glow | 9 | Dye glow emission gain |
flameAbsorption | 0.55 | Extinction added by flame |
lightAbsorption | 2.2 | Self-shadow strength |
detail | 1.4 | Noise displacement of the lookup, in cells at a 64 grid |
densityPower | 1 | Above 1 sharpens soft edges |
colorAbsorption | 0.35 | 0 = grey extinction, 1 = dye absorbs its complement (ink) |
reflection | 1 | Volume reflection on surfaces whose alpha < 1 at the domain floor |
edgeFade | 0.6 | Metres over which density fades toward the open sides and top |
selfShadow | true |
#Lighting
Lights the volume only. See the volume's lighting.
| Key | Default | |
|---|---|---|
keyDirection | [-0.45, 0.75, -0.5] | Toward the key light (normalised for you) |
keyColor | [0.16, 0.18, 0.3] | Linear RGB |
ambient | [0.012, 0.012, 0.022] | Linear RGB |
phaseG | 0.45 | Henyey–Greenstein anisotropy |
#Flame
| Key | Default | |
|---|---|---|
palette | null | [dark, mid, hot] linear RGB. null = blackbody. A dragonBreath effect overrides it while it runs |
soot | [0.2, 0.2, 0.2] | Colour of the soot that burning adds to the dye |
#Post
| Key | Default | |
|---|---|---|
exposure | 1 | |
bloom | 0.5 | Bloom strength |
bloomThreshold, bloomKnee | 0.9, 0.5 | Soft-knee threshold |
bloomRadius | 0.9 | Upsample gain across the six levels |
heatHaze | 0 | Distortion behind hot fluid |
huePreserve | 0.35 | Hue-preserving tone mapping for bright emissive colours |
saturation, contrast, vignette | 1.05, 1, 0 | |
temporal | 0.14 | TAA blend of the volume buffer (0 = off) |
#The full default object
{
controls: { swirl: 1, density: 1, buoyancy: 1, dissipation: 1, glow: 1, speed: 1 },
physics: {
weight: 0, damping: 0.35, cooling: 0.8, vorticity: 2.2, dissipation: 0.85, glowDissipation: 0.9,
burnRate: 3, turbulence: 0.7, expansion: 0.0045, sharpness: 1, velocitySharpness: 0,
},
render: {
density: 2.6, flame: 4.2, glow: 9.0, flameAbsorption: 0.55, lightAbsorption: 2.2, detail: 1.4,
densityPower: 1, colorAbsorption: 0.35, reflection: 1, edgeFade: 0.6, selfShadow: true,
},
lighting: { keyDirection: [-0.45, 0.75, -0.5], keyColor: [0.16, 0.18, 0.3], ambient: [0.012, 0.012, 0.022], phaseG: 0.45 },
flame: { palette: null, soot: [0.2, 0.2, 0.2] },
post: {
exposure: 1, bloom: 0.5, bloomThreshold: 0.9, bloomKnee: 0.5, bloomRadius: 0.9, heatHaze: 0,
huePreserve: 0.35, saturation: 1.05, contrast: 1.0, vignette: 0, temporal: 0.14,
},
}