Usage
Add bevy and bevy_pixels to Cargo.toml. Be sure to disable bevy's render and bevy_wgpu features (with default-features = false) as they will conflict with rendering provided by bevy_pixels.
[]
= { = "0.18", = false }
= "0.16"
Add PixelsPlugin to your Bevy project.
use *;
use *;
Use Bevy's Single system param in systems that target the single-window case.
Bevy and Pixels version mapping
| bevy_pixels | bevy | pixels |
|---|---|---|
| 0.16 | 0.18 | 0.16 |
| 0.15 | 0.15 | 0.15 |
| 0.14 | 0.14 | 0.15 |
| 0.13 | 0.13 | 0.13 |
| 0.12 | 0.12 | 0.13 |
| 0.11 | 0.11 | 0.13 |
| 0.9-0.10 | 0.10 | 0.12 |
| 0.8 | 0.9 | 0.11 |
| 0.7 | 0.9 | 0.10 |
| 0.6 | 0.8 | 0.10 |
| 0.5 | 0.7 | 0.9 |
| 0.3-0.4 | 0.6 | 0.9 |
| 0.2 | 0.5 | 0.8 |
| 0.1 | 0.5 | 0.3 |
Examples
minimal
This example demonstrates rendering a solid color to the pixel buffer.
multiple_windows
This example demonstrate usage of multiple windows each with their own pixel buffer.
custom_render
This example demonstrate usage of a custom render system. Default render cargo feature must be disabled before defining a custom render system. Use default-features = false in Cargo.toml.
bounce
More advanced example based off the minimal-winit example from the pixels project. It demonstrates rendering dynamic content to the pixel buffer as well as custom configuration for PixelsPlugin and PixelsOptions on the primary window.

mandelbrot
Simple colorful fractal example that demonstrates interactive rendering with bevy_pixels. Left click zooms in on the clicked point, right click zooms back out, the native window is resizable without changing the zoom level, and the web build fills the browser viewport.

Running examples natively
Build and run example with just. See Justfile for more details. Install just with cargo install just.
Running examples in web browser
Install dependencies.
Build and serve example for web.
Open localhost:8080 in your web browser to run the example.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.