Phosphor
A high-performance GPU-accelerated waveform visualization library for Rust that renders waveforms with CRT-oscilloscope-like intensity grading.
In-browser demo. Press the play button! (Details below.)
Quick Start
Add to your Cargo.toml:
[]
= { = "phosphor" }
The easiest way to use Phosphor is headless mode, where Phosphor itself manages the WGPU context.
use ;
The generated image:

(Link may be broken if you're not viewing this readme on Gitlab.)
To integrate Phosphor into a GUI application that already uses wgpu for rendering,
you will get better performance by drawing directly to the screen.
Features
- GPU-accelerated rendering: Uses wgpu for high-performance visualization
- Automatic intensity adjustment: Optional feature for optimal brightness normalization
- Customizable colormaps
- Headless rendering: Off-screen rendering support
- Cross-platform: Windows, macOS, Linux, and WebAssembly
Architecture
The waveform is rendered in multiple steps.
- Waveform rendering: Line segments rendered as oriented quads into an intermediate texture.
- Auto-intensity (optional): Automatic brightness normalization via compute shader
- Post-processing: The intermediate texture is rendered to the screen, while applying the false-color mapping.
Running the Demos
Phosphor currently comes with 2 demos.
-
The first one is a real-time visualizer for the Oscillofun track. It's a song that, when both audio channels are connected to an oscilloscope in XY mode, draws a neat animation.
The demo is available online. Press the 'Play' button after it is done loading.
-
A simple interactive time-domain visualization of a long waveform. The demo does compile to WASM, but is not available online yet. Clone the repository, and run: