pixfx

pixfx documentation

pixfx is a set of pixel-art effects and the Rust engine that draws them. An effect is written once and produces the same pixels natively and in WebAssembly.

What you can do with it

The effects are ports of pixelfx (JavaScript). The ported effects match pixelfx exactly: fire/candle, fire/campfire and fire/brazier render with 0 differing pixels against pixelfx commit 044e12a.

Pick a package

You want toUsePage
Export sheets or GIFs for an engine that plays sprite sheetspixfx CLICommand line, Sheet format
Show effects on a web page or a canvas gamepixfx-canvasCanvas renderer
Use effects in a Phaser 4 gamepixfx-phaserPhaser plugin
Read raw frames in JS and draw them yourself (WebGL, a worker, tests)pixfx-wasmJS engine
Render, hash or export frames from Rustpixfx-core, pixfx-effects, pixfx-exportRust API
Paint effects in a gpui apppixfx-gpuigpui

Crates and packages

PathWhat it is
crates/pixfx-coreThe engine: frame with colour and additive light, painter, Effect/Instance, render_frames, composite, frame_hash.
crates/pixfx-effectsThe effects and their registry, EFFECTS and effect(id).
crates/pixfx-cliThe pixfx binary: sheet, render --gif, parity.
crates/pixfx-exportSprite sheets, beanfx-layout JSON and GIFs.
crates/pixfx-wasmThe engine for JavaScript: effects(), meta(id), new Fx(id, opts).
crates/pixfx-canvasA Canvas 2D renderer, Stage, with its own loop or a host-owned one.
packages/pixfx-phaserPhaser 4 scene plugin, effects drawn on worker threads.
crates/pixfx-gpuiLive playback inside gpui. Needs a gpui fork; a separate workspace.
examples/gpui-webA gpui web app playing the candle and campfire.

Next

Getting started builds the repository and plays an effect. Concepts explains colour and light layers, back and front, origins, margins and time steps, which every other page relies on.