---
title: "Blend smoke sprite sheets over a three.js scene"
description: "Blend flipbook smoke over a three.js scene: normal alpha blending, transparent true, depthWrite false, opacity from the sheet's alpha and soft edges."
canonical: https://appliedmanifold.com/guides/threejs-smoke-blending/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Guides](https://appliedmanifold.com/guides/)
3.  Smoke blending

GUIDE // THREE.JS

# How to make smoke flipbook particles blend correctly over the scene in three.js

Use normal alpha blending with transparent set to true and depthWrite set to false, so your smoke sprites fade over what is behind them without cutting square holes in each other. Let three.js sort transparent objects from back to front, and take opacity from the sheet's alpha so the edges of each puff stay soft.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [See the examples →](https://appliedmanifold.com/docs/pyrofx/examples/)

-   Godot 4 Available
-   Unity Manual setup
-   Unreal Engine Manual setup
-   Roblox Studio Manual setup
-   **three.js** Available

A draft compile is from $0.05, and new accounts start with $5 of usage.

**SMOKE\_PLUMEFINAL**

![First frame of the smoke\_plume bake](/bakes/smoke_plume/poster.webp)

Smoke plume, 7.0 x 10.8 m, compiled with Spatial Compiler. [Spec →](https://appliedmanifold.com/docs/pyrofx/examples/#ex-smoke_plume)

01 // HOW TO

## Build a smoke material from the sheet

1.  Load `main_pos.png` and leave its `colorSpace` at the default for the shader.
2.  Make a `ShaderMaterial` that reads opacity from the alpha and shading from the green channel (light from above), tinted by a smoke color uniform.
3.  Set `transparent: true`, `depthWrite: false` and `blending: THREE.NormalBlending`.
4.  Put it on a plane that faces the camera and drive the frame from elapsed time, 16 frames per second for the 4 s plume.

smoke.frag

```
uniform sampler2D posMap;  // main_pos.png
uniform vec3 smokeColor;
uniform float frame;
uniform float opacity;
varying vec2 vUv;

void main() {
  vec2 cell = vec2(mod(frame, 8.0), 7.0 - floor(frame / 8.0));
  vec4 pos = texture2D(posMap, (vUv + cell) / 8.0);
  gl_FragColor = vec4(smokeColor * pos.g, pos.a * opacity);
}
```

02 // REAL OUTPUT

## Smoke that climbs and spreads

The smoke column is a one-shot left after a burst. Its frames span 6 s and bunch up early, so step through the frame times from `layout.json` and stop at frame 63 instead of wrapping.

**SMOKE\_COLUMNFINAL**

![First frame of the smoke\_column bake](/bakes/smoke_column/poster.webp)

Smoke column, 8.2 x 9.9 m, compiled with Spatial Compiler. [Spec →](https://appliedmanifold.com/docs/pyrofx/examples/#ex-smoke_column)

03 // COMMON PROBLEMS

## Fix holes, hard lines and dark rims

-   Square holes where puffs overlap mean `depthWrite` is still on, so a near puff hides the far ones behind it.
-   A hard line where smoke meets the ground comes from the flat sprite cutting through the scene. A soft-particle shader that fades by scene depth fixes it; see [soft particles](https://appliedmanifold.com/learn/soft-particles/).
-   A dark rim around each puff comes from black color in transparent pixels, which filtering mixes into the edge. Fill the color out past the edges of the smoke in your image editor.

04 // RELIGHTING

## Toward full six-way lighting

The green channel is one fixed light direction. The sheets hold six (six-way lighting, the smoke lit from six directions), and a shader that blends them by your light's direction relights the smoke as the light moves. Writing that blend in three.js is up to you, and nobody has tested one with these sheets.

Godot 4 gets a ready scene that relights the smoke. A native six-way material for three.js is not built yet; the documented snippet plays one packed lighting direction.

05 // RELATED

## Related pages

-   [Smoke and scene lighting Godot 4Light smoke particles in Godot 4 with a lit material, Backlight and normal maps, or six-way sheets that follow the sun.](https://appliedmanifold.com/guides/godot-smoke-scene-lighting/)
-   [Lit smoke in Unity UnityLight flipbook smoke in Unity with a URP lit particle material and a precomputed lighting channel chosen to match your sun.](https://appliedmanifold.com/guides/unity-smoke-lighting/)
-   [Additive fire three.jsMake a three.js fire flipbook glow with additive blending and a ShaderMaterial that decodes flame color and brightness.](https://appliedmanifold.com/guides/threejs-additive-fire/)
-   [three.js smoke plume three.jsA smoke plume that leans with the wind and loops every 4 seconds, played in three.js with a documented snippet.](https://appliedmanifold.com/effects/threejs-smoke-plume/)
-   [three.js VFX three.jsFire, smoke, explosion and dust effects in three.js: sprite sheets you play with a documented snippet, next to Godot 4's ready scene.](https://appliedmanifold.com/effects/threejs-vfx/)
-   [Six-way lightingSix-way lighting stores smoke lit from six directions in two textures, so a shader can relight the flipbook from your scene light.](https://appliedmanifold.com/learn/six-way-lighting/)
-   [OutputsWith the default export, each view writes four sheets, `<view>_pos.png`, `_neg.png`, `_colour.png` and `_aux.png`, plus `layout.json`, two still previews, the animated `preview_anim.png` and `bake_report.json`. Sheets are 8 x 8 tiles of 256 px by default.](https://appliedmanifold.com/docs/pyrofx/outputs/)

[All pages in Guides →](https://appliedmanifold.com/guides/)

[← Additive fire](https://appliedmanifold.com/guides/threejs-additive-fire/)[Sprites that face the camera →](https://appliedmanifold.com/guides/threejs-sprites-face-camera/)

06 // FAQ

## three.js smoke blending questions

[All questions →](https://appliedmanifold.com/faq/)

**README.THREEJS\_SMOKE\_BLENDING**

### How do I make a smoke effect in three.js?

Use a smoke sprite sheet on a Sprite with normal blending, transparent enabled and depthWrite disabled so smoke layers cleanly over the scene.

### How do I make smoke sprites blend cleanly over a three.js scene?

Set transparent true and depthWrite false on the material, draw smoke after opaque objects and sort overlapping sprites back to front.

### How should transparency be stored in a six way lightmap?

Store straight opacity in the alpha channel of one texture, such as the alpha channel of main\_pos.png in Spatial Compiler outputs.

### Should smoke plume use additive or normal alpha blending in three.js?

Use THREE.NormalBlending with transparent true and depthWrite false since the plume has no flame layer.

## Compile your first effect

You pay per compile and see the price before it runs. New accounts start with $5 of usage.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [Outputs →](https://appliedmanifold.com/docs/pyrofx/outputs/)

[All effects, guides and explainers →](https://appliedmanifold.com/effects/)
