• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

djeedai / bevy_hanabi / 11656781118
66%

Build:
DEFAULT BRANCH: main
Ran 04 Nov 2024 02:03AM UTC
Jobs 1
Files 27
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Nov 2024 01:58AM UTC coverage: 56.541% (-1.3%) from 57.846%
11656781118

push

github

web-flow
Allow particles to be arbitrary meshes. (#377)

Currently, Hanabi requires that particles be 2D quads. This is
sufficient for a good deal of VFX, but in many cases 3D objects are
required: smoke puffs, bullet casings, etc. This commit fixes this
deficiency by allowing particles to take on arbitrary meshes. To set the
mesh of a particle, use the new `EffectAsset::mesh` builder method. By
default, the mesh is a 2D quad.

The implementation is straightforward. The previously-hard-wired quad
vertices have been replaced with a `Handle<Mesh>`. The patch uses the
existing `bevy_render` infrastructure to upload the mesh to the GPU and
retrieve the vertices. Perhaps the most significant change is the
generalization of rendering to allow for indexed drawing in addition to
non-indexed. Because indexed drawing has a different on-GPU format for
indirect draw commands from that of non-indirect draw commands, some
additional bookkeeping is required.

This patch also adds support for a few features useful for 3D rendering:

* A `size3` attribute has been added, to allow the size to be controlled
  in 3D.

* The `SetSizeModifier` now takes a 3D size gradient instead of a 2D
  one.

* Vertex normals are available to modifiers via the `normal` shader
  variable, as long as they call the new
  `RenderContext::set_needs_normal` method.

A new example, `puffs`, has been added to demonstrate the use of 3D
meshes. It depicts the Bevy test fox running with cartoony smoke puffs
emitted at a constant rate behind it. Each puff consists of multiple
spherical mesh particles offset with some random jitter. A custom
Lambertian lighting modifier is supplied with the example, in order to
make the smoke puffs not appear solid white. (This modifier dramatically
improves the look of this example, but it's very limited, so I didn't
upstream it to Hanabi proper. A proper PBR lighting modifier would be
useful, but would be a significant amount of work, so... (continued)

33 of 182 new or added lines in 7 files covered. (18.13%)

29 existing lines in 2 files now uncovered.

3557 of 6291 relevant lines covered (56.54%)

22.53 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
0.0
0.0% src/render/batch.rs
2
62.99
-0.83% src/modifier/mod.rs
3
52.57
-0.92% src/asset.rs
15
73.08
-5.26% src/lib.rs
128
21.97
-1.7% src/render/mod.rs

Uncovered Existing Lines

Lines Coverage ∆ File
7
21.97
-1.7% src/render/mod.rs
22
73.08
-5.26% src/lib.rs
Jobs
ID Job ID Ran Files Coverage
1 11656781118.1 04 Nov 2024 02:03AM UTC 27
56.54
GitHub Action Run
Source Files on build 11656781118
  • Tree
  • List 27
  • Changed 9
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 1cd61b03 on github
  • Prev Build on main (#11638278810)
  • Next Build on main (#11659658896)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc