Bevy Jam 5, Radiance Cascades, and Calculators in many ui kits
2024-07-22
Bevy Jam 5 is underway! If you haven't joined in yet you still have a whole week so head on over to Itch.io and join the jam.
We've got a whole bunch to cover this week including some exciting crate releases that, if you ask me, were motivated by Bevy Jam 5, and a number of full open source games and releases.
We'll start off as usual covering some project ongoings and merges before getting deeper into the ecosystem and even seeing a 3D editor for Mario Kart Wii tracks.
Observers
Observers are brand new in Bevy 0.14 but their implementation in that release is considered the "first" implementation. With that in mind we're already starting to see Observers evolve further with Event Bubbling, a new OnReplaced
event and allowing Observer systems to have outputs;
If you're still looking for a Hooks and Observers overview, check out this video which is mentioned later in this issue.
Unofficial Bevy Meetup 5
Bevy Meetup #5 was livestreamed just before Bevy Jam #5 with two talks.
- Florian - Truck Instrument Cluster powered by Bevy
- Spencer - Compute centric vector graphics with
bevy_vello
Calculating UI Toolkits
There are many implementations of UI toolkit in progress these days, which means picking one could be a decision on your list. Over the last week a number of different toolkit authors have built out Calculator examples.
The first calculator example is here in the #ui channel in the Bevy Discord, and there's some good discussion from framework authors detailing the different approaches and priorities of crates like sickle_ui and quill.
Radiance Cascades
Radiance Cascades are an interesting global illumination technique that have been gaining interest over the last few weeks after a YouTube video was released talking about them.
While the video was recent, the paper (YouTube link) was released almost a year ago which has resulted in useful visualizations of the technique, fancy demos, and articles having been written about it. There's a lot of information about them these days.
bevy_flatland_radiance_cascades and bevy_radiance_cascades are a couple of recent implementations in Bevy.
While there have been other research-level efforts over the last year such as bevy_ridiculous_ssgi, 3d Radiance Cascades don't seem to work out as well as 2d, but the technique is great for 2d.
wgpu goes major
wgpu got its first major release, starting with v22.0.0 which follows on from the previous 0.21.0. This is notably not a "stable 1.0 release" but reflects the fact that wgpu has been used in production by many projects including Bevy, and powers the implementation of the WebGPU API in Servo, Firefox, and JavaScript for Deno.
It is a well-known fact that WGPU has been used for applications and platforms already in production for years, at this point. We are often concerned with tracking breaking changes, and affecting these consumers' ability to ship. By releasing our first major version, we publicly acknowledge that this is the case.
Naming closure systems
14369 introduces a new API to enable renaming closure-based systems, which allows them to show up in tooling as named item rather than ::{closure}
. This will show most often in tools like bevy_mod_debugdump
and tracing.
app
.add_systems(Startup, IntoSystem::into_system(|name: SystemName| {
println!("System name: {}", name.name().to_owned());
}).with_name("print_test_system"));
Isometries
#14269 introduces the concept of Isometry types into the bevy_math. Isometries represent rigid motion in two and three dimensions such as translation and rotation but not reflection. If you want to learn more about them, check out the follow up PR with adds some more examples to what can feel like a very abstract concept.
One common operation is to compute an isometry representing the relative positions of two objects for things like intersection tests. This can be done with an inverse transformation:
use bevy_math::{Isometry2d, Rot2, Vec2};
let circle_iso = Isometry2d::from_translation(Vec2::new(2.0, 1.0));
let rectangle_iso = Isometry2d::from_rotation(Rot2::degrees(90.0));
// Compute the relative position and orientation between the two shapes
let relative_iso = circle_iso.inverse() * rectangle_iso;
// Or alternatively, to skip an extra rotation operation:
let relative_iso = circle_iso.inverse_mul(rectangle_iso);
Cyclic Splines
14106 introduced a new trait CyclicCubicGenerator
to power the generation of cyclic curves through control points. This trait is implemented for a number of different types including CubicHermite
, CubicCardinalSpline
, CubicBSpline
, and LinearSpline
.
plugin_group! macro
14339 introduced a new plugin_group!
macro which is a more restrictive version of building a custom PluginGroup
but provides some nice wins in terms of keeping documentation up to date. This is the same trait that DefaultPlugins
and MinimalPlugins
implement.
Built in PostProcessing stack
#13695 introduces a new built-in postprocessing shader that's design to hold miscellaneous postprocessing effects. It then continues to start with chromatic aberration as the first effect. The effect is usable through adding ChromaticAberration
to your camera.
The PR, as is usual with pcwalton's effects, is well documented, explained, and comes with a new usage example: post_processing
. I highly suggest checking this PR out if you're interested in how Bevy's rendering systems work.
Localized Volumetric Fog
Currently, volumetric fog is global and affects the entire scene uniformly. This is inadequate for many use cases, such as local smoke effects. To address this problem, this commit introduces fog volumes, which are axis-aligned bounding boxes (AABBs) that specify fog parameters inside their boundaries. Such volumes can also specify a density texture, a 3D texture of voxels that specifies the density of the fog at each point.
A new example, fog_volumes
, has been added. It demonstrates a single fog volume containing a voxelized representation of the Stanford bunny. The existing volumetric_fog
example has been updated to use the new local volumetrics API.
Alice's Merge Train is a maintainer-level view into active PRs, both those that are merging and those that need work. There's 38 PRs this week!
Showcase
Bevy work from the #showcase channel in Discord and around the internet. Use hashtag #bevyengine.
bevy_radiance_cascades (wip)
showcase
This is an implementation of Radiance Cascades (which we cover in more depth in the overview this week). The discord thread contains a link to an extremely information year-long thread in the Graphics Programming Discord if you're interested in implementing Radiance Cascades yourself.
Desktop Pet
showcase
A desktop pet in Bevy! This one is also open source so take a look and make your own!
Kataster
showcase
Kataster is a 2d space shooter that just upgraded to Bevy 0.14 and now uses features like state scoped entities and sub-states. Some crates used include avian2d, bevy_hanabi, and leafwing_input_manager
El Mono Steam Release
showcase
This project was originally an effort to go through the entire dev cycle to see how viable bevy is for more sustained projects. Due to the state it was able to achieve, it was released on Steam.
The game uses bevy_steamworks
and vanilla bevy_ui.
3D editor for Mario Kart Wii tracks
showcase
Each course’s functional data is stored in a .kmp file, which is what the program edits. Each color represents a collision type such as road, off-road, etc. The gizmos are powered by transform-gizmo
To Build a Home: Custom Cursor
showcase
To Build a Home implemented a custom cursor that cursor changes into a hand when hovering over an object you can interact with. This work uses a UI image but there's also an open PR for custom cursor support in Bevy at a deeper level.
TheSeekerGame
showcase
This 2d action/adventure game is being built by a group of four as an open source project. Its described as a combination of hollow knight and risk of rain 1 and there's even documentation.
Crates
New releases to crates.io and substantial updates to existing projects
Beet 0.0.3
crate_release
Beet is a behavior library that uses entities to represent nodes in behavior graphs, connecting them with the the Parent/Children relationship we all know and love.
Previously change detection was used for control flow, replacing this with observers allows for instant graph traversal and solves what was the biggest painpoint in the library.
Bevy Lunex 0.2.2
crate_release
bevy_lunex is a path based retained layout engine for Bevy entities, built around vanilla Bevy ECS and is the ui crate behind the Bevypunk example.
0.2.2 adds free cursor movement support for Gamepads.
Bevy_Fabulous 0.1.1
crate_release
Bevy fabulous aims to provide a framework for encapsulating and coupling a loaded GLTF to it's gameplay components without using heavy tooling, or opinionated plugins.
Bevy Easy Compute 0.14
crate_release
bevy_easy_compute is an updated version of the older bevy_app_compute project, aiming to make it easier to write and run compute shaders in Bevy apps.
Bevy Caravan v0.1.0
crate_release
This is a procedural macro designed to make expressing query.get statements easier.
ref_caravan!(entity :: query = bindings);
would expand into
let Ok(bindings) = query.get(entity) else { continue; };
bevy_ecs_tilemap 0.14
crate_release
bevy_ecs_tilemap is an ECS driven tilemap rendering library. It’s designed to be fast and highly customizable. Each tile is considered a unique entity and all tiles are stored in the game world.
As is typical, the examples directory contains demos for square and hex grids, isometric levels, proof-of-concept ldtk and tiled levels (although you may prefer bevy_ecs_ldtk or bevy_ecs_tiled which build on top of tilemap), chunking, custom materials, and more.
Version 0.14 brings it up to date with Bevy 0.14, which we normally wouldn't cover, except this is notable because there wasn't a 0.13 release to crates.io.
sickle_ui
crate_release
sickle_ui is a widget library built on top of bevy's internal bevy_ui.
bevy_keith
crate_release
With a shiny new tiled SDF renderer, this 2D graphics library offers an immediate-mode style API to draw highly dynamic texts and shapes in a single (or so) draw call, with built-in support for anti-aliasing and high DPI rendering (native physical resolution).
bevy_cobweb_ui v0.1.0
crate_release
Newly released UI crate layered on sickle_ui. Adds reactivity helpers using bevy_cobweb and an asset-driven workflow with advanced localization support.
bevy_octopus v0.3.0
crate_release
A Low-level ECS-driven network plugin for Bevy. Support tcp udp websocket and json bincode auto transformer
Educational
Tutorials, deep dives, and other information on developing Bevy applications, games, and plugins
Advancing Pong Part A: With Physics Using Bevy Rapier
educational
Part two of "Zero to Pong", which introduces Bevy Rapier to the project.
Add error message if states schedule missing (usually because StatesPlugin hasn't been added) authored by cBournhonesque
Basic isometry types authored by mweatherley
update example low_power authored by mockersf
update gltf example to use type-safe `GltfAssetLabel::Scene` authored by johannesvollmer
bevy_reflect: Feature-gate function reflection authored by MrGVSV
Dirty fix for App hanging when windows are invisible on WindowsOS authored by MiniaczQ
Lighting Should Only hold Vec<Entity> instead of TypeId<Vec<Entity>> authored by re0312
Fix swapped docs for `Rot2::rotation_to/from_y` authored by mweatherley
Fix prepass batch authored by re0312
Add `Isometry2d::from_xy` and `Isometry3d::from_xyz` authored by Jondolf
Add `inverse_mul` and `inverse_transform_point` for isometries authored by Jondolf
bevy_reflect: `TypeInfo` casting methods authored by MrGVSV
Fix inaccurate docs for `Commands::spawn_empty` authored by benfrankel
Register VisibleMeshEntities authored by IceSentry
Add a direct link in the docs to the Discord's #working-groups channel authored by therealbnut
bevy_reflect: Nested `TypeInfo` getters authored by MrGVSV
Minimal Bubbling Observers authored by NthTensor
Start a built-in postprocessing stack, and implement chromatic aberration in it. authored by pcwalton
add debug logging to ascertain the base path the asset server is using authored by alphastrata
Align `Scene::write_to_world_with` to match `DynamicScene::write_to_world_with` authored by dmyyy
examples: Add `Type Data` reflection example authored by MrGVSV
Expose Winit's `KeyEvent::repeat` in `KeyboardInput` authored by daxpedda
Allow observer systems to have outputs authored by cBournhonesque
bevy_math: faster sphere sampling authored by ickk
Fix inconsistency in `KeyboardInput` examples to match migration guide authored by chompaa
Faster MeshletMesh deserialization authored by JMS55
Make initial `StateTransition` run before `PreStartup` authored by MiniaczQ
Rename `bevy_core::name::DebugName` to `bevy_core::name::NameOrEntity` authored by GauravTalreja
Add insert_by_id and try_insert_by_id to EntityCommands authored by SOF3
Fix overflow in `RenderLayers::iter_layers` authored by Azorlogh
Implement FromIterator/IntoIterator for dynamic types authored by SpecificProtagonist
Add support for skybox transformation authored by Soulghost
Clarify GlobalTransform::transform_point authored by masonk
Clearer spatial bundle pub const docs authored by torsteingrindvik
Allow non-static trigger targets authored by SpecificProtagonist
Fix `bevy_window` failing with `serialize` feature authored by BD103
Specify test group names in github summary for compile fail tests authored by Brezak
Component Lifecycle Hook & Observer Trigger for replaced values authored by Pixelstormer
Clean up UiSystem system sets authored by UkoeHB
Remove unused `default` feature from `bevy_window` authored by BD103
Implement `Bounded2d` for `Annulus` authored by Jondolf
Improve isometry docs authored by Jondolf
Fix error/typo in SMAA shader authored by Luracasmus
Remove second generic from `.add_before`, `.add_after` authored by benfrankel
remove rounded_borders and merge with borders example authored by ChristopherBiscardi
bevy_reflect: Add `DynamicClosure` and `DynamicClosureMut` authored by MrGVSV
Pack multiple vertex and index arrays together into growable buffers. authored by pcwalton
update bunny meshlet url authored by mockersf
Added `new` method to Cone 3D primitive authored by FarmingtonS9
Make `Task`s functional on WASM authored by JoJoJet
bevy_reflect: Improve `DynamicFunction` ergonomics authored by MrGVSV
Fix the dev docs robots.txt containing a literal \n instead of a newline authored by Brezak
Allow volumetric fog to be localized to specific, optionally voxelized, regions. authored by pcwalton
Remove need for EventLoopProxy to be NonSend authored by hymm
`plugin_group!` macro (adopted) authored by BD103
Cyclic splines authored by mweatherley
Update `trigger_observers` to operate over slices of data authored by mnmaita
Derive and reflect `Debug` for `CameraRenderGraph` authored by SludgePhD
Test for ambiguous system ordering in CI authored by Vrixyz
Recalibrated observe benchmark authored by re0312
Make names of closure systems changable authored by flash-freezing-lava
Make the `GltfNode::children` links actually point to children. authored by pcwalton
Deprecate `is_playing_animation` authored by FastestMolasses
Add support for environment map transformation authored by Soulghost
docs: Fix incorrect docs in the run conditions example authored by LiamGallagher737
Make `Viewport::default()` return a 1x1 viewport authored by SludgePhD
Fix tracing with `transform_hierarchy` example authored by rparrett
Set scissor on upscale to match camera viewport authored by tychedelia
Fix button placement in `split_screen` example authored by rparrett
fix building cargo_gltf with feature dds authored by mockersf
Using Cas instead of CAS #14341 authored by Cioraz
Want to contribute to Bevy?
Here you can find two types of potential contribution: Pull Requests that might need review and Issues that might need to be worked on.
Pull Requests Opened this week
Fast renormalize authored by IQuick143
Smoothness for (cubic) curves / cubic spline integration authored by mweatherley
Fix single keyframe animations. authored by yrns
Export glTF skins as a Gltf struct authored by barsoosayque
Remove `transform_hierarchy` example authored by BD103
Add `FilteredAccess::empty` and simplify the implementatin of `update_component_access` for `AnyOf`/`Or` authored by SkiFire13
Build dev docs with cargo docs-rs authored by Brezak
Optimize transform propagation authored by CrazyRoka
Add example showing how to use SpecializedMeshPipeline authored by IceSentry
Unignore `Camera.target` field for reflection authored by SludgePhD
Feature flag to add repr(c) to bevy types authored by ScottKane
Update Access and FilteredAccess to use sorted vecs instead of FixedBitSet authored by cBournhonesque
Only propagate transforms entities with GlobalTransforms. authored by StarArawn
Disallow empty cubic and rational curves authored by mweatherley
bevy_reflect: get_represented_kind_info APIs for reflected kinds authored by torsteingrindvik
Replace winit's synthetic events by our own key tracking authored by Azorlogh
Remove manual --cfg docsrs authored by Coder-Joe458
Fix the example regressions from packed growable buffers. authored by pcwalton
Fix commands not being Send / Sync in 0.14 authored by luca-della-vedova
Update WGPU to version 22 authored by callym
Changed `Mesh::attributes*` functions to return `MeshVertexAttribute` authored by SarthakSingh31
feat: expose the default font bytes authored by seabassjh
Disabled usage of the POLYGON_MODE_LINE gpu feature in the examples authored by SarthakSingh31
Issues Opened this week
Tracking issue: Isometry follow-ups authored by mweatherley
Some images compressed with `CompressedImageSaver` cause panics after loading authored by Seldom-SE
Rename `bevy_reflect`'s `documentation` feature to `reflect_documentation authored by alice-i-cecile
Add more docs on Isometry types authored by alice-i-cecile
Mouse click frame drop on Bevy 0.14.0 authored by JonasAAA
Approximate/Fast normalisation for Dir{2,3} authored by IQuick143
Panic calling `DynamicScene::write_to_world` with `MapEntities` and `ComponentHooks` authored by mrchantey
Add 'new' method to Cone 3D primitive authored by FarmingtonS9
State docs should inform the need for the StatePlugin to be used authored by Commathingy
Use bicubic filtering in lightmaps authored by mgi388
Remove `get_at` method from `Map` trait (reflection) authored by alice-i-cecile
Observers tests are not particularly robust authored by alice-i-cecile
Bubbling observers `Traversal` should use `QueryData` authored by alice-i-cecile
`trigger_observers` should operate on slices of data authored by alice-i-cecile
Allow fragment shader to access vertex position authored by ivanceras
Running the same system in two different states is treated as ambiguous by the scheduler authored by dothanhtrung
Allow specifying Event bubbling info as proc macro attributes authored by ItsDoot
`OnReplace` observer needs to be reflectable authored by alice-i-cecile
AutoExposure doesn't seem to work on web authored by alice-i-cecile
Types related to Contrast Adaptive Sharpening should be `Cas*` instead of `CAS*` authored by rparrett
Bevy does not report `.just_pressed` in this edge case involving windows focus and cursor grab authored by rsk700
3D line example broken on web authored by ShadowMitia
Passing image data to bevy_window for window icons and cursors authored by alice-i-cecile
Unsoundness in dynamic queries: sparse filters are ignored if the typed query is dense authored by SkiFire13
`FilteredEntityRef`/`FilteredEntityMut`'s access is empty when used in composite queries authored by SkiFire13
3d shapes web example crashes when enabling wireframes authored by aevyrie
Upstream asset loading solutions authored by janhohenheim
Some examples are broken after packed growable buffers authored by mockersf
`Mesh` should allow iterating over the stored `MeshVertexAttribute`s authored by SludgePhD
Scene struct missing summary authored by TheBicPen
Processed assets should be able to have a different file extension than unprocessed assets authored by BeastLe9enD
bevy_reflect: Consider API for getting kind info authored by torsteingrindvik
It's possible to hit unreachable code of the standard library when compiling with `dynamic_linking` and `release` on Windows in certain cases authored by janhohenheim
Allow bundle to be inserted without overwriting duplicate components authored by jpetkau
0.14 Windows 11 bug: Invisible App Window stuck at frame 1 and never render after authored by wentao
Linker error when using meshlet_processor feature on Linux authored by 66OJ66
Animation: Layered Blend Per Bone authored by ethereumdegen
Method to get a random entity from a query authored by npetrangelo
Asset data from code is not sent to the GPU appropriately (on webgl2) authored by mxple
Reflect dynamic components / type registrations for dynamic types authored by SpecificProtagonist
Improve color grading: Hue shift based on shadows/midtones/highlights authored by ethereumdegen