14 releases (7 breaking)

0.8.2 Nov 18, 2024
0.8.0 Jul 16, 2024
0.7.0 Feb 27, 2024
0.6.0 Nov 8, 2023
0.2.0 Aug 18, 2022

#43 in Rendering

Download history 2/week @ 2024-08-16 4/week @ 2024-08-23 6/week @ 2024-08-30 4/week @ 2024-09-06 73/week @ 2024-09-13 124/week @ 2024-09-20 48/week @ 2024-09-27 16/week @ 2024-10-04 15/week @ 2024-10-11 5/week @ 2024-10-18 27/week @ 2024-11-01 12/week @ 2024-11-08 141/week @ 2024-11-15 35/week @ 2024-11-22 7/week @ 2024-11-29

202 downloads per month

MIT license

83KB
1.5K SLoC

bevy_pixel_buffer

Crates.io docs.rs Crates.io

A library to draw pixels in bevy.

  • Easy to set up and use.
  • Can be integrated into an existing project.
  • Allows dynamic resize of the pixel buffer to fill an area such as the window.
  • Support for multiple pixel buffers.
  • Allows to easily attach a compute shader to update the pixels.
  • egui integration (through bevy_egui) to show the pixels inside the UI.

Examples

A basic example,

use bevy::prelude::*;
use bevy_pixel_buffer::prelude::*;

fn main() {
    let size = PixelBufferSize {
        size: UVec2::new(32, 32),
        pixel_size: UVec2::new(16, 16),
    };

    App::new()
        .add_plugins((DefaultPlugins, PixelBufferPlugin))
        .add_systems(Startup, pixel_buffer_setup(size))
        .add_systems(Update, update)
        .run();
}

fn update(mut pb: QueryPixelBuffer) {
    pb.frame().per_pixel(|_, _| Pixel::random());
}

Basic example output

More examples

Features

  • egui*. Egui integration.
  • rayon. Enables extra alternative functions that use rayon.
  • rand. Enables extra functionality related to random values.

* Disabled by default.

Bevy versions

Version compatibility table.

bevy bevy_pixel_buffer
0.14 0.8
0.13 0.7
0.12 0.6
0.11 0.5
0.10 0.4
0.9 0.3
0.8 0.2

Dependencies

~39–77MB
~1.5M SLoC