Play a simulated fire sprite sheet in three.js

Describe the fire and get a looping 64-frame sprite sheet with its timing file. A short ShaderMaterial plays it on one plane and lights the smoke from your scene's light.

Brazier fire in three.js

  • 64frames that loop every 2 s
  • 2048 pxsheets with 256 px frames
  • $0.10per full-quality compile
  • Under 40 sfrom spec to sheets

Rendered in three.js from the compiled sheets, with a six-way ShaderMaterial on one plane, a point light and bloom. The brazier and wall are three.js meshes. Compiled on the hosted API on 3 December 2026.

Web-ready fire

Fire on the web is usually an animated GIF or a few additive sprites, and both look flat next to lit 3D models.

A simulated sheet keeps the flame's shape and motion and stays light for the browser: one plane and a few textures.

What the terms mean

  • Sprite sheet

    A grid of frames in one image.

    One texture holds the whole animation, so it loads once.

  • UV offset

    Which part of the sheet the plane shows.

    Stepping it through the grid plays the frames in order.

  • Bloom

    A post effect that spreads bright pixels into a glow.

    The flame looks hot instead of painted on.

How it works

  1. Describe the fire

    Tell your agent what is burning and how big, such as a fire in an iron brazier about 1 m tall.

  2. See the price, then compile

    A full-quality compile costs $0.10. Repeat compiles of the same spec are free.

  3. Load it in three.js

    Load the sheets with TextureLoader, read the grid and timing from the layout file and step the frame in your render loop.

Load a sprite sheet in three.js

Questions

Do I need a special three.js loader?

No. TextureLoader loads the PNG sheets and the layout file is plain JSON with the grid, frame count and frame times.

How heavy is the effect in the browser?

One plane, a few texture reads a pixel and a shader of about 20 lines. The three 2048 px sheets are the main cost, so load them once and reuse them.

All use cases

Use with your agent

Paste the prompt into Claude Code, Cursor or Codex. Your agent connects to Spatial Compiler and comes back with four sprite sheets, a layout file, a preview and the shader code that plays them.

New accounts start with $5 of usage, and you see the price of each job before it runs.

Agent prompt

Connect the Spatial Compiler MCP server at https://spatialcompiler.dev/mcp if it isn't connected yet. Use pyrofx to compile a looping fire in an iron brazier about 1 m tall, at full quality, and add it to my three.js scene on one plane with a ShaderMaterial that reads the layout file. Start with a draft right away and ask before running a final compile.

Or add the server yourself in Claude Code:

claude mcp add --transport http spatial-compiler https://spatialcompiler.dev/mcp

Set it up in Cursor, Codex or another agent

Once connected, your agent can call the starter tool. It returns a ready fire Draft spec and the exact call that runs it. Your first 100 fire Drafts are free with the $5 signup credit.