---
title: "Steady fire effect in three.js from a sprite sheet"
description: "Play a steady fire in three.js today: a snippet loads the packed RGBA sprite sheet on a THREE.Sprite and steps the texture offset. Steps and code."
canonical: https://appliedmanifold.com/effects/threejs-steady-fire/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Effects](https://appliedmanifold.com/effects/)
3.  [three.js VFX](https://appliedmanifold.com/effects/threejs-vfx/)
4.  three.js steady fire

EFFECTS // THREE.JS

# How to make a steady fire in three.js

In three.js, you can play a steady fire about 1.5 m across that loops every 2 seconds. A snippet loads the packed RGBA sprite sheet on a THREE.Sprite, sets the texture repeat to one eighth, and wraps back to frame 0. Godot 4 gets a ready scene that relights the smoke.

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

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

**FIREFINAL**

![First frame of the fire bake](/bakes/fire/poster.webp)

Fire, 4.1 x 7.0 m, compiled with Spatial Compiler. [Spec →](https://appliedmanifold.com/docs/pyrofx/examples/#ex-fire)

01 // WHAT YOU GET

## What you get for steady fire in three.js

The steady fire is the plainest fire example: one source about 1.5 m across that burns in place, with flames and a little smoke rising to about 7 m. The loop is 2 seconds, and the last 12 frames blend into the first, so the wrap does not show.

You get four PNG sheets of 64 frames, a `layout.json` with the timing, and previews, which three.js plays through a small material.

02 // HOW TO

## Play the steady fire in three.js

1.  Ask your agent for the effect (for example "a campfire like the steady fire example but half the size") with `export.pack` writing the light from above into RGB and opacity into alpha, so one PNG holds gray shading you can tint. (`main_pos.png` as it comes holds three light directions in RGB, not a color.) Load it with `TextureLoader` and set `texture.repeat.set(1 / 8, 1 / 8)`.
2.  Put it on a `THREE.Sprite` with a `SpriteMaterial` (`transparent: true`, `depthWrite: false`) so it always faces the camera. For the flame, make a second texture in an image editor, `main_colour.png` multiplied by the alpha of `main_neg.png` squared, and draw it on a second sprite with `THREE.AdditiveBlending`. That texture is normalized, so restore the peak on the flame sprite with `material.color.setScalar(emitMax)`, where `emitMax` is `scales.emit_max_hdr`.
3.  Each frame, pick the tile: column `i % 8` and row `Math.floor(i / 8)`, then set `texture.offset.set(col / 8, 1 - (row + 1) / 8)`.
4.  Advance `i` by 32 frames a second, the steady fire's real speed (64 frames in 2 s), and wrap it with `i % 64` so it loops.
5.  Set `sprite.scale.set(s, s, 1)` with `s` the meters per tile from `layout.json`, a little over 7 m for the steady fire, so it shows at its real size.

03 // ADJUST IT

## Adjust the steady fire for your scene

Ask your agent to scale it down for a campfire, up for a burning truck, or to add more smoke for burning fuel. A new seed gives you a second fire with the same look that does not flicker in step with the first.

04 // SETTINGS

## Settings in the steady fire spec

One emitter burns in place, and the loop settings blend the last 12 frames into the first. Change the emitter size for a smaller or larger fire.

Ask your agent to change these and compile again; the [full fire spec](https://appliedmanifold.com/docs/pyrofx/examples/#ex-fire) lists every value.

05 // RELATED

## Related pages

-   [Godot steady fire Godot 4A steady fire about 1.5 m across that loops every 2 seconds, dropped into a Godot 4 scene by your agent.](https://appliedmanifold.com/effects/godot-steady-fire/)
-   [Unity steady fire UnityA steady fire about 1.5 m across that loops every 2 seconds, played in Unity by hand today.](https://appliedmanifold.com/effects/unity-steady-fire/)
-   [Unreal steady fire Unreal EngineA steady fire about 1.5 m across that loops every 2 seconds, played in Unreal Engine by hand today.](https://appliedmanifold.com/effects/unreal-steady-fire/)
-   [Roblox steady fire Roblox StudioA steady fire about 1.5 m across that loops every 2 seconds, played in Roblox Studio by hand today.](https://appliedmanifold.com/effects/roblox-steady-fire/)
-   [three.js fire three.jsA looping fire, from a burning wreck to a fire whirl or a window fire, played in three.js with a documented snippet.](https://appliedmanifold.com/effects/threejs-fire/)
-   [three.js explosion three.jsAn explosion that plays once, a ground fireball or a shell impact, played in three.js with a documented snippet.](https://appliedmanifold.com/effects/threejs-explosion/)
-   [Steady fire sprite sheetA steady fire about 1.5 m across as a 2 second looping sprite sheet for wrecks and campfires, sized to your scene and lit with a flicker light.](https://appliedmanifold.com/effects/steady-fire-sprite-sheet/)
-   [HDR emissive fireHDR emissive fire stores flame brightness above white, so bloom makes the core glow while the smoke stays lit by the scene.](https://appliedmanifold.com/learn/hdr-emissive-fire/)
-   [Loop a sprite animation three.jsLoop a fire or smoke sprite sheet in three.js from elapsed time, so it plays at the same speed on every screen.](https://appliedmanifold.com/guides/threejs-loop-sprite-animation/)
-   [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 three.js VFX →](https://appliedmanifold.com/effects/threejs-vfx/)

[← three.js dust](https://appliedmanifold.com/effects/threejs-dust/)[three.js fire whirl →](https://appliedmanifold.com/effects/threejs-fire-whirl/)

06 // FAQ

## Questions about steady fire in three.js

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

**README.THREEJS\_STEADY\_FIRE**

### Is there a steady fire effect for three.js?

Yes. Ask your agent for a campfire like the steady fire example but half the size, starting from the fire example.

### How do I loop a steady fire sprite sheet in three.js?

Advance a frame counter at 64 frames per 2 seconds, wrap it modulo 64 and set texture.offset from the column and row.

### How do I make a realistic steady fire in three.js?

Start from a simulated fire instead of manual particles. One emitter burns in place and blends the last 12 frames into the first.

### How do I keep a steady fire in proportion in three.js?

Keep the Sprite square because every tile is square. Set sprite.scale.set(s, s, 1) using the meters per tile from layout.json.

### Should the first and last frames of a steady fire loop match?

Yes. The steady fire compile blends its last 12 frames into its first, so frame 64 leads straight back to frame 1 every 2 seconds.

## 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/)
