Loading shader
Thick rolling fog over a warm light. Your cursor wipes a path through it; the edges glow where the light scatters, and the fog curls back in.
fog, moderate, MIT, v1.0.0
This is the code for the shader exactly as it is set above. It updates as you change the controls.
Props of the FogVeil React component. The JavaScript version takes the same names in its settings object.
| Prop | Type | Default | Description |
|---|---|---|---|
| colors | [string, string, string, string] | ["#0b0d12", "#4a5262", "#1b2350", "#ffb27a"] | Fog in shadow, Fog in light, Light, deep, Light, core. Hex colours. |
| speed | number | 1 | Speed. Range 0 to 3. |
| scale | number | 1 | Higher makes the fog finer. Range 0.4 to 2.5. |
| intensity | number | 1 | How wide a path the cursor clears. Range 0.4 to 2.5. |
| refill | number | 1 | How quickly the fog rolls back in. Range 0.2 to 3. |
| seed | number | 31 | Seed. Range 0 to 999. |
| paused | boolean | false | Freeze the animation on the current frame. |
| maxDpr | number | 2 | Upper bound for devicePixelRatio. Lower it to save GPU time. |
| className | string | none | Classes for the canvas, for example to position it. |
| style | CSSProperties | none | Inline styles for the canvas. |
Moderate. Cost 2 of 3.
Layered noise per pixel. Fine full-screen on recent phones and laptops; on weak GPUs the resolution steps down automatically.