A Love Story: PicBreeder meets ShaderToy
ShaderJoy is an interactive evolutionary playground for animated shaders. Inspired by PicBreeder and ShaderToy, it presents a small grid of live shader variations and asks a simple question:
"Which shader sparks joy?"
When you click a shader, it becomes the parent of the next generation. New variations are generated by mutating the parent’s code, and the process repeats - no parameters to tune, no goals to optimize, just human taste guiding evolution.
ShaderJoy explores human-in-the-loop generative art, where aesthetic selection replaces traditional fitness functions, and complex visuals emerge through iteration, mutation, and choice.
The project is written in Rust, uses wgpu for GPU rendering, and integrates llm for generating shader mutations.
-
Install Rust: The Rust toolchain ships with
rustc(compiler) andcargo(package manager).- macOS/Linux:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shthen restart your terminal. - Windows: download and run the installer from https://rustup.rs/ (WSL works too).
- Verify:
rustc --versionandcargo --versionshould both print versions.
- macOS/Linux:
-
Get the code:
git clone {this-repo}cd ShaderJoy
-
Run it:
cargo run --release- The first build can take a few minutes while Rust and GPU deps are compiled. When it finishes, a window will open showing the evolving shader grid. Click a shader tile to make it the parent for the next generation.
-
(Optional) Enable LLM-driven mutations: set an API key for your chosen provider before running. Defaults use Gemini via
GOOGLE_API_KEY, or setOPENAI_API_KEY/ANTHROPIC_API_KEYand update the provider in code if you prefer.- Example for macOS/Linux:
export GOOGLE_API_KEY=your-key-here - On Windows PowerShell:
$env:GOOGLE_API_KEY="your-key-here"
- Example for macOS/Linux:
-
If the app fails to start with a GPU error, update your graphics drivers.
wgpuuses the native backend (Metal on macOS, DirectX on Windows, Vulkan on many Linux distros).