---
title: "Fireball effect in three.js from a sprite sheet"
description: "Play a fireball 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-fireball/
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 fireball

EFFECTS // THREE.JS

# How to make a fireball in three.js

In three.js, you can play a fireball that bursts from the ground and rolls upward in 3.7 seconds. A snippet loads the packed RGBA sprite sheet on a THREE.Sprite, sets the texture repeat to one eighth, and removes it after the last frame. 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.

**FIREBALLFINAL**

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

Fireball, 9.4 x 13.4 m, compiled with Spatial Compiler. [Spec →](https://appliedmanifold.com/docs/pyrofx/examples/#ex-fireball)

01 // WHAT YOU GET

## What you get for fireball in three.js

The fireball is a fuel explosion that bursts from the ground, swells, rolls at its edge and rises, about 9.4 m wide and 13.4 m tall at its peak. It plays once over 3.7 seconds. More of its 64 frames go to the fast first moments, so the burst does not look choppy.

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 fireball in three.js

1.  Ask your agent for the effect (for example "a fireball about half the size of the example, played once") 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.  The fireball's frames crowd its fast start, so pick `i` from the clock: `i = layout.frame_times_s.findIndex((t) => t >= elapsed)`. When that returns -1, after 4 s, call `sprite.removeFromParent()` and `material.dispose()`.
5.  Set `sprite.scale.set(s, s, 1)` with `s` the meters per tile from `layout.json`, a little over 13.4 m for the fireball, so it shows at its real size.

03 // ADJUST IT

## Adjust the fireball for your scene

Use it for vehicles, fuel tanks and big set pieces. Ask your agent for a smaller fireball, a darker smoke cap, or several seeds so a chain of explosions does not repeat the same shape.

04 // SETTINGS

## Settings in the fireball spec

A short burst of hot fuel starts at ground level and burns only where it meets air, so the ball burns at its rolling surface instead of all at once.

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

05 // RELATED

## Related pages

-   [Godot fireball Godot 4A fireball that bursts from the ground and rolls upward in 3.7 seconds, dropped into a Godot 4 scene by your agent.](https://appliedmanifold.com/effects/godot-fireball/)
-   [Unity fireball UnityA fireball that bursts from the ground and rolls upward in 3.7 seconds, played in Unity by hand today.](https://appliedmanifold.com/effects/unity-fireball/)
-   [Unreal fireball Unreal EngineA fireball that bursts from the ground and rolls upward in 3.7 seconds, played in Unreal Engine by hand today.](https://appliedmanifold.com/effects/unreal-fireball/)
-   [Roblox fireball Roblox StudioA fireball that bursts from the ground and rolls upward in 3.7 seconds, played in Roblox Studio by hand today.](https://appliedmanifold.com/effects/roblox-fireball/)
-   [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/)
-   [Fireball sprite sheetA fuel fireball as a 3.7 second one-shot sprite sheet, why its frames bunch at the start, and how to play it once in Godot 4 and by hand.](https://appliedmanifold.com/effects/fireball-sprite-sheet/)
-   [Loop vs one-shotLooping effects repeat until stopped and one-shot effects play once and fade out, and each needs its own frames and settings.](https://appliedmanifold.com/learn/loop-vs-one-shot/)
-   [Play an explosion once three.jsPlay an explosion sprite sheet once in three.js, then remove the sprite and free its material and texture.](https://appliedmanifold.com/guides/threejs-play-once/)
-   [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 window fire](https://appliedmanifold.com/effects/threejs-window-fire/)[three.js impact →](https://appliedmanifold.com/effects/threejs-impact/)

06 // FAQ

## Questions about fireball in three.js

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

**README.THREEJS\_FIREBALL**

### Is there a fireball effect for three.js?

Yes. Ask your agent for a fireball about half the size of the example, played once, starting from the fireball example.

### How do I play a fireball once and remove it in three.js?

Pick each frame from layout.frame\_times\_s, stop after frame 63 at 3.7 seconds, then call sprite.removeFromParent() and material.dispose().

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

Start from a simulated explosion instead of manual particles. Hot fuel bursts at ground level and burns where it meets air.

### How do I keep a fireball 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.

### How many frames does the fireball effect use?

The fireball compile uses 64 frames over 3.7 seconds and gives more frames to the fast burst at the start.

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