NatureGL Magicv1.0.0

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.

js
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.

KeyDemo rangeMultiplies
swirl0 – 2Vorticity confinement, swirl-field spin and pull, ring confinement, force-field push, and part of the ring spin (0.6 + 0.4 · swirl)
density0.2 – 3Rendered opacity (render.density) and the vortex-ring torus density
buoyancy0 – 3Heat lift, 6 m/s² per unit of temperature
dissipation0 – 3Dye fade. Glow fade uses it too, but never below 0.35
glow0 – 3All emission: effect and impulse glow, render.glow, render.flame, and the spell orbs' lights
speed0.2 – 2Simulation time scale (applied after dt is clamped to 1/120 … 1/30 s)

#Physics

KeyDefault
weight0Downward force per unit of smoke density: ink sinks
damping0.35Velocity damping (1/s)
cooling0.8Temperature decay
vorticity2.2Vorticity-confinement gain. Keep it about 1 – 4
dissipation0.85Dye density fade (1/s)
glowDissipation0.9Glow fade (1/s)
burnRate3Fuel → heat. Dragon breath needs about 5
turbulence0.7Noise forcing where the fluid is hot or dense
expansion0.0045Divergence from combustion
sharpness1MacCormack strength for dye and state (0 = first-order, softer)
velocitySharpness0MacCormack strength for velocity (livelier flow)

#Render

KeyDefault
density2.6Extinction per unit density
flame4.2Flame emission gain
glow9Dye glow emission gain
flameAbsorption0.55Extinction added by flame
lightAbsorption2.2Self-shadow strength
detail1.4Noise displacement of the lookup, in cells at a 64 grid
densityPower1Above 1 sharpens soft edges
colorAbsorption0.350 = grey extinction, 1 = dye absorbs its complement (ink)
reflection1Volume reflection on surfaces whose alpha < 1 at the domain floor
edgeFade0.6Metres over which density fades toward the open sides and top
selfShadowtrue

#Lighting

Lights the volume only. See the volume's lighting.

KeyDefault
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
phaseG0.45Henyey–Greenstein anisotropy

#Flame

KeyDefault
palettenull[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

KeyDefault
exposure1
bloom0.5Bloom strength
bloomThreshold, bloomKnee0.9, 0.5Soft-knee threshold
bloomRadius0.9Upsample gain across the six levels
heatHaze0Distortion behind hot fluid
huePreserve0.35Hue-preserving tone mapping for bright emissive colours
saturation, contrast, vignette1.05, 1, 0
temporal0.14TAA blend of the volume buffer (0 = off)

#The full default object

src/config/defaults.js (DEFAULT_PARAMS, comments removed)
{
  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,
  },
}