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 sheetsThe pixfx-export scriptsScripts, Sheet format
Show effects on a web page or a canvas gamepixfx-canvas2dCanvas 2D shell
Use effects in a Phaser 4 gamepixfx-phaserPhaser plugin
Use effects in a Pixi 8 gamepixfx-pixiPixi shell
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/*/examplesScripts over the library: sprite_sheet, gif, bake, parity, bench, poses, the pixel steps.
crates/pixfx-exportSprite sheets, beanfx-layout JSON and GIFs.
crates/pixfx-wasmThe engine for JavaScript: effects(), meta(id), new Fx(id, opts).
packages/pixfx-webThe JS runtime every JS shell shares: the wasm, painting workers, shared frames, a stage per scene.
packages/pixfx-canvas2dCanvas 2D shell: effects painted on workers, drawn among your own drawing.
packages/pixfx-phaserPhaser 4 scene plugin, effects drawn on worker threads.
packages/pixfx-pixiPixi 8 shell, 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.