Smoke

연기

Smoke rises and spreads from an emitter, changing color and fading over time.

Also known as: Smokesmoke simulation

Moves in browsers that support WebGPU

This device could not render the demo — showing a still

React
// Renders only in browsers with WebGPU.
import { Shader, Smoke } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <Smoke />
    </Shader>
  )
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<script setup lang="ts">
import { Shader, Smoke } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <Smoke/>
  </Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<script>
  import { Shader, Smoke } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <Smoke />
</Shader>
Solid
// Renders only in browsers with WebGPU.
import { Shader, Smoke } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Smoke />
    </Shader>
  )
}
JavaScript
// Renders only in browsers with WebGPU.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'Smoke',
    }
  ]
}, { disableTelemetry: true })

Props · Smoke

Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).

NameValueDefaultRange / optionsDescription
colorAStart Color#fc83f9—Color of fresh smoke
colorBEnd Color#c21c79—Color smoke transitions to as it ages
stopsColorsSet in codenull—Multi-stop gradient colors (overrides Color A / Color B when set)
emitFromEmit From
x0.5y1
{"x":0.5,"y":1}x, y: 0 – 1The emission source point
directionDirection00 – 360 (step 1)Emission direction (0 = up, 90 = right, 180 = down, 270 = left)
speedSpeed200.1 – 50 (step 0.1)Emission velocity strength
spreadSpread600 – 180 (step 1)Emission cone angle in degrees
emitRadiusEmit Size0.080.01 – 0.3 (step 0.01)Size of the emission area
intensityIntensity10.1 – 1 (step 0.01)Smoke emission density
dissipationDissipation0.20.1 – 3 (step 0.1)How fast smoke fades over time
detailDetail250 – 50 (step 1)Fine-scale swirling detail
gravityGravity0.5-2 – 2 (step 0.1)Downward gravitational pull on smoke
colorDecayColor Decay0.40 – 3 (step 0.1)How quickly smoke shifts from Color A to Color B
mouseInfluenceCursor Influence0.10 – 2 (step 0.01)Strength of cursor influence
mouseRadiusCursor Radius0.10.02 – 0.5 (step 0.01)Radius of cursor influence area
colorSpaceColor Spacelinearlinear · oklch · oklab · hsl · hsv · lchColor space for color interpolation

Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id

Smoke spreads from a chosen emitter and gradually fades. Like incense rising in a narrow plume before dispersing into the air, it adds depth and movement to a background.

`emitFrom` sets the source position (default `{x: 0.5, y: 1}`), `direction` sets its direction (default 0 degrees, upward), and `speed` sets emission velocity (default 20, range 0.1–50). `spread` controls the cone angle (default 60 degrees, range 0–180), while `dissipation` controls fading (default 0.2, range 0.1–3).

This generator fills the screen on its own. A dark background or simple shape lets the smoke show through; over a busy photo or paragraph, overlapping wisps can make the scene hard to follow.

When to use

Use it for an atmospheric hero background, a short scene transition, or an emitter such as fire or incense. Avoid it behind dense text and information.

Open as page ↗