πŸŽ† CPU-driven, batch-rendered particle system for the Bevy game engine.

Overview

Crates.io Crates.io CI

Bevy Firework πŸŽ†

Bevy firework is a particle system plugin where particles are simulated on the CPU and use GPU batching for rendering. This allows each particle system to be rendered in a single draw call (rather than one per particle).

While not as fast as a pure GPU-based particle system, this provides a massive speed-up from the naive approach to CPU-based particles (making it possible to render tens of thousands of particles without noticeable framerate drops) and maintains much of the flexibility of CPU-based particle systems (e.g. easy access to physics data for particle collision, simplified particle system animation).

collision example pbr example sparks example

Current features

  • Billboarded particles.
  • Configurable integration with Bevy's PBR rendering (i.e. particles can receive shadows, are affected by fog and lighting changes).
  • Particle collision with arbitrary bevy_xpbd colliders.
  • WASM and WebGL compatible.
  • Soft particle edges.
  • Animated properties: certain parameters can be defined as a custom curve to express changes over a particle's lifetime:
    • Scale
    • Color
  • Randomized properties: certain properties can be randomized, so that they are randomly sampled for every particle:
    • Particle lifetime
    • Initial linear velocity
    • Initial radial velocity
    • Initial scale
  • Emission shapes:
    • Point
    • Disk
    • Sphere
  • One-shot emission mode, or continuous emission.

Current limitations

  • Can't use custom images for particles.

Version table

bevy_firework bevy bevy_utilitarian
0.1 0.12 0.2
0.2 0.12 0.3
0.3 0.13 0.4
You might also like...
A game made in one week for the Bevy engine's first game jam

ΒΏQuien es el MechaBurro? An entry for the first Bevy game jam following the theme of "Unfair Advantage." It was made in one week using the wonderful B

A Client/Server game networking plugin using QUIC, for the Bevy game engine.
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

A light-weight Anchor-Offset based 2D sprite rendering system for the bevy engine.
A light-weight Anchor-Offset based 2D sprite rendering system for the bevy engine.

Bevy AoUI A light-weight anchor-offset based 2D sprite layout system for the bevy engine. Bevy AoUI provides a light-weight rectangular anchor-offset

Basic first-person fly camera for the Bevy game engine

bevy_flycam A basic first-person fly camera for Bevy 0.4 Controls WASD to move horizontally SPACE to ascend LSHIFT to descend ESC to grab/release curs

Inspector plugin for the bevy game engine
Inspector plugin for the bevy game engine

bevy-inspector-egui This crate provides the ability to annotate structs with a #[derive(Inspectable)], which opens a debug interface using egui where

Crossterm plugin for the bevy game engine
Crossterm plugin for the bevy game engine

What is bevy_crossterm? bevy_crossterm is a Bevy plugin that uses crossterm as a renderer. It provides custom components and events which allow users

Concise Reference Book for the Bevy Game Engine

Unofficial Bevy Cheat Book Click here to read the book! Concise reference to programming in the Bevy game engine. Covers useful syntax, features, prog

Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions
Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions

Introduction Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions. (hand interaction with boxes missing

A physics lib for the bevy game engine based on physme

physimple Physimple aims to be the simplest(and capable) physics engine(currently for bevy) WARNING Beware for breaking changes with each update for n

Comments
  • Soft particle-scene intersection, solid collider collision

    Soft particle-scene intersection, solid collider collision

    Soft particle-scene intersection

    Billboarded particles produce hard edges when intersecting with scene geometry, which is ugly. This PR introduces configurable soft particle edges which fade in intersections with geometry, very useful for smoke-like particle effects. It also adds configuration options for rounded particle edge fading.

    This feature requires the camera to have the depth prepass enabled (i.e. the DepthPrepass component added). If it is not present, the behaviour is as before.

    Solid collider collisions

    Previously, all colliders were treated as hollow. This adds support for solid colliders, and forces particles out of them.

    opened by mbrea-c 0
  • Ensure uniform buffer is 16-byte aligned

    Ensure uniform buffer is 16-byte aligned

    WebGL requires that uniform buffers are 16-byte aligned. This PR allows bevy_firework to be used for wasm targets by adding the missing padding.

    Thanks to bestranar for providing the patch!

    opened by mbrea-c 0
  • Particle collision

    Particle collision

    This PR adds optional particle collision with arbitrary bevy_xpbd colliders. It is behind the physics_xpbd feature flag, so it can be compiled out.

    It also parallelizes updates of particle systems, which can improve performance when there are many different particle systems running at once.

    opened by mbrea-c 0
  • Add missing serialization and remove unused bundle parameter

    Add missing serialization and remove unused bundle parameter

    As an remnant of my first implementation of this plugin, the ParticleSpawnerBundle required &mut Assets<Mesh>. This is because I used to use mesh instancing to draw particles.

    Since I'm now using a hardcoded billboarded quad, we do not need to require a mesh, and we can replace the specialized mesh pipeline with a specialized render pipeline.

    This PR also introduces an uniform buffer for per-system parameters such as pbr, which were previously unnecessarily bundled with each particle's data.

    opened by mbrea-c 0
Releases(v0.3.0)
  • v0.3.0(Mar 5, 2024)

    Highlights

    • Updated to bevy 0.13 and bevy_xpbd 0.4 thanks to @Affinator
    • Particle collision with arbitrary bevy_xpbd colliders
    • WebGL support
    • Soft particle-scene intersections (fading out of particles where they intersect the scene)

    Changelog

    • Particle collision by @mbrea-c in https://github.com/mbrea-c/bevy_firework/pull/3
    • Fix bug when running without default features, add stress tests by @mbrea-c in https://github.com/mbrea-c/bevy_firework/pull/4
    • Ensure uniform buffer is 16-byte aligned by @mbrea-c in https://github.com/mbrea-c/bevy_firework/pull/5
    • Soft particle-scene intersection, solid collider collision by @mbrea-c in https://github.com/mbrea-c/bevy_firework/pull/7
    • Update to bevy 0.13 and bevy_xpbd 0.4 by @Affinator in https://github.com/mbrea-c/bevy_firework/pull/9

    New Contributors

    • @Affinator made their first contribution in https://github.com/mbrea-c/bevy_firework/pull/9

    Full Changelog: https://github.com/mbrea-c/bevy_firework/compare/v0.1.0...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Feb 20, 2024)

Owner
Manuel Brea Carreras
Manuel Brea Carreras
Hanabi β€” a particle system plugin for the Bevy game engine.

Hanabi β€” a particle system plugin for the Bevy game engine

Jerome Humbert 256 Dec 30, 2022
Bevy is a refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

John Winston 3 Jun 3, 2022
rust-browser-game but native and rendered with ncurses in C without the Browser

Spin-off of rust-browser-game-but-sdl but with ncurses Nothing much to say. Just see rust-browser-game-but-sdl and rust-browser-game. Quick Start $ ma

Tsoding 8 Apr 21, 2022
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
Contain an energetic quantum particle by strategically placing walls in this 48-hour jam game

Contain an energetic quantum particle by strategically placing walls in this 48-hour jam game. Made with Bevy Engine.

Nilay Savant 5 Aug 18, 2023
A refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

Bevy Engine 21.1k Jan 4, 2023
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
An atomic save/load system for Bevy Game Engine.

☒️ Bevy Atomic Save An atomic save/load system for Bevy. Features Save and load a World into a RON file on disk Control which entities should particip

null 11 Jan 28, 2023
2d Endless Runner Game made with Bevy Game Engine

Cute-runner A 2d Endless Runner Game made with Bevy Game Engine. Table of contents Project Infos Usage Screenshots Disclaimer Project Infos Date: Sept

JoaoMarinho 2 Jul 15, 2022
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021