Additive Blending, Required Components, and shipping games
2024-10-07
The state of Animation is looking great as we near a potential 0.15 release candidate: with additive blending landing and more PRs in the works.
This week we also see updates on a number of Bevy games in the ecosystem, a whole host of Required Components upgrades are happening, and more.
Let's start off with something that takes a bit more explanation.
Screen Space Ambient Occlusion with Visibility Bitmasks (ssaovb)
Ambient Light is a light that affects all objects in a scene "equally" and Ambient Occlusion is the idea that a give point on a surface is obscured from that light to some extent.
Screen Space Ambient Occlusion is a technique for approximating Ambient Occlusion. It uses the depth buffer to compare the depth of the point being rendered to the depth of surrounding points and tries to compute the Ambient Occlusion value based on that.
Previously, Bevy implemented a version of SSAO using "Ground Truth Ambient Occlusion", or GTAO. #13454 implements an alternative called "Visibility Bitmasks".
Side note: it is so awesome that we can dig up the open source contribution that implemented the original implementation while reading the new implementation.
Here are some additional links if this topic is of interest to you (Pulled from the GitHub PR comments for reviewers).
- Screen Space Indirect Lighting with Visibility Bitmask (pdf)
- SSAO using Visibility Bitmasks
- Screen Space Indirect Lighting with Visibility Bitmask: Improvement to GTAO/SSAO Real-Time Ambient Occlusion Algorithm (GLSL Shader Implementation)
Required Components
The Required Components refactor continues with
#15269 introduces the ability to use a closure as a Required Component default value.
#[derive(Component)]
#[require(
FocusPolicy(|| FocusPolicy::Block)
)]
struct SomeComponent;
While Required Components enable adding sets of Components, #15026 introduces the ability to remove sets of Components. Its notable that the functions added here are short-term "footgunnable" methods that removes all components of the bundle and its required components. Future work will include introducing methods that are safer to use in more situations.
#15458 introduces the ability to define Required Components at runtime, which is useful for plugins that optionally require components based on other enabled plugins, as well as defining requirements for first-party types (for example: "each Handle should require my custom rendering data components").
Additive Blending
Building on top of some really interesting work in #15589, Additive Blending has been merged in #15631! This is the feature that was the last requirement to enable functionality like a walking animation and a sword swinging animation at the same time.
The animation_masks
example has been updated to demonstrate blending and masks and if you're interested in the details of how nodes are evaluated, make sure to read #15589.
Curve-based animation
#15434 building on top of the Generic Animation work to allow arbitrary curves to be used by the animation system to animate arbitrary properties.
#14788 introduced a number of ways to create a transition between two values. This includes LinearCurve
, CubicBezierCurve
, StepCurve
, ElasticCurve
, and FunctionCurve
(including functions like quadratic ease out)
Capsule2d inner rectangle
#15388 adds a new function to get the inner rectangle of a 2d capsule.
try_despawn
If you try to despawn an entity that doesn't exist, Bevy will print a warning. As of #15480, new try_despawn*
methods will silence this warning if attempting to depawn entities that are potentially already despawned is intentional behavior.
Alice's Merge Train is a maintainer-level view into active PRs, both those that are merging and those that need work.
Showcase
Bevy work from the #showcase channel in Discord and around the internet. Use hashtag #bevyengine.
Real-Time Strategy for a Game Jam
showcase
This small, space-themed RTS was built for a local game jam. The jam ran for a month with a theme of "Astro".
The game is playable on Itch.io and the source is available on GitHub as well.
Small Bevy Dungeon
showcase
This is a small turn based dungeon crawler using Bevy and bevy_ecs_ldtk.
The game is playable on Itch and the source is available on GitHub
Pop up debug menu
showcase
A pop up debug menu implemented with egui. Similar vibes to bevy_inspector_egui but with more functionality.
left-to-right and right-to-left
showcase
A bevy-native implementation of RTL layout, showing off left-to-right as well as right-to-left text.
Jarl Building
showcase
Jarl is a fantasy colony builder. This demo shows off the construction mechanics with menus, placement, lighting, and more.
Unit Control System
showcase
This is the first test for a unit control system. The game is a Bevy port of the developer's existing game .
Elevated Arcana
showcase
Elevated arcana is an action tower defense game with a focus on elemental magic. The alpha is currently available on iOS.
Crates
New releases to crates.io and substantial updates to existing projects
bevy_mod_opacity
crate_release
Hierarchical opacity management and fade in and fade out for bevy.
HillVacuum mapeditor v0.8.0
crate_release
HillVacuum is a Doom Builder and TrenchBroom inspired editor that allows the creation of bidimensional maps through the manipulation of convex polygons, placement of items and entities, and texture mapping.
In addition to a number of changes, 0.8 drops support for map versions lower than 0.7.
bevy_flowfield_tiles_plugin 0.11
crate_release
A vector field pathfinding algorithm for grouped/flocking behavior. 0.11 brings a rewritten Line-of-Sight calculation with a refactored integration layer.
Educational
Tutorials, deep dives, and other information on developing Bevy applications, games, and plugins
Infinite chunk based terrain generation in Bevy 0.14
educational
Continuing on from the first video (which covered generating low-poly terrain), this video covers building an infinite chunk-based terrain system that spawn and despawns chunks as a player moves.
rename `QuerySingle` to `Single` authored by hooded-shrimp
Fix regression in `bevy_gltf` build authored by BenjaminBrienen
Curve-based animation authored by mweatherley
Runtime required components authored by Jondolf
Fix window spawning triggering ButtonInput<KeyCode>::just_pressed/just_released authored by SpecificProtagonist
Add `to_inner_rectangle`, `area` and `perimeter` methods to `Capsule2d` authored by 13ros27
Small addition to `World::flush_commands` explaining how `spawn` will cause it to panic. authored by 13ros27
Migrate meshes and materials to required components authored by Jondolf
Migrate motion blur, TAA, SSAO, and SSR to required components authored by Jondolf
Migrate audio to required components authored by Jondolf
Remove `TransformCurve` authored by mweatherley
Use circle gizmos for capsule authored by IceSentry
Implement `SystemParam::queue()` method for blanket implementation of `ParamSet` authored by mrtracy
Allow access a method handler authored by notmd
Enable `EntityRef::get_by_id` and friends to take multiple ids and get multiple pointers back authored by ItsDoot
Cleanup `clearcoat` example authored by tim-blackbird
add curve utilities to create curves interpolating/easing between two values authored by RobWalt
Added visibility bitmask as an alternative SSAO method authored by dragostis
Documentation for variadics authored by BenjaminBrienen
Revert "Have EntityCommands methods consume self for easier chaining" authored by tim-blackbird
bevy_reflect: Add `DeserializeWithRegistry` and `SerializeWithRegistry` authored by MrGVSV
Add UI `GhostNode` authored by villor
Impose a more sensible ordering for animation graph evaluation. authored by pcwalton
Better warnings about invalid parameters authored by MiniaczQ
Despawn and despawn_recursive benchmarks authored by rudderbucky
Add try_despawn methods to World/Commands authored by rudderbucky
Rename observe to observe_entity on EntityWorldMut authored by kristoff3r
Fix `extract_text2d_sprite` entity leak authored by ickshonpe
Fix entity leak in `extract_uinode_borders` authored by ickshonpe
Eliminate redundant clamping from sample-interpolated curves authored by mweatherley
System param for dynamic resources authored by chescock
send_events is ambiguous_with_all authored by IceSentry
Add method to remove component and all required components for removed component authored by rewin123
Get rid of unnecessary mutable access in ui picking backend authored by tim-blackbird
Fix deferred rendering authored by kristoff3r
Implement additive blending for animation graphs. authored by pcwalton
Zero Copy Mesh authored by atlv24
Split off bevy_image from bevy_render authored by atlv24
Minor fixes for `bevy_utils` in `no_std` authored by bushrat011899
Fix cargo-ndk build command authored by eero-lehtinen
drop info locks in single threaded authored by robtfm
Allow a closure to be used as a required component default authored by fluffiac
Invert the dependency between bevy_animation and bevy_ui authored by atlv24
Fix `bevy_window` and `bevy_winit` readme badges authored by LiamGallagher737
Fix audio not playing authored by Jondolf
Remove bevy_animation dependency on bevy_text authored by atlv24
Clean up the `simple_picking` example authored by tim-blackbird
Fix text measurement when multiple font sizes are present authored by UkoeHB
Display the bounds of each text node in the `text_debug` ui example authored by ickshonpe
Fix QuerySingle -> Single missed in example authored by mgi388
Fix additive blending of quaternions authored by mweatherley
Migrate cameras to required components authored by Jondolf
fix: corrected projection calculation of camera sub view authored by m-edlund
Deprecate `Events::oldest_id` authored by urben1680
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
bevy_reflect: Add casting traits to support `Box` and other wrapper types authored by MrGVSV
Remove `petgraph` from `bevy_ecs` authored by bushrat011899
Fix window close delay authored by hooded-shrimp
bevy_reflect: Add `ReflectSerializerProcessor` authored by aecsocket
introduction of `ConvexPolygon` and `ConvexPolygonMeshBuilder` authored by tomi-font
Add Support for Triggering Events via `AnimationEvent`s authored by atornity
Synchronize removed components with the render world authored by kristoff3r
Screen shake example authored by moOsama76
Yet another Migrate bevy_sprite to required components authored by KirmesBude
Overflow clip margin authored by ickshonpe
PoC for normal systems (including exclusive) as observers authored by ItsDoot
Optimize param validation through `get_param(...) -> Option<Out>` authored by MiniaczQ
Remove `Interaction`, and replace it with `bevy_picking` based fields on `Button` authored by alice-i-cecile
Text rework authored by UkoeHB
Feature-gate all image formats authored by clarfonthey
Watching versions of `bevy/get` and `bevy/list` with HTTP SSE authored by LiamGallagher737
Track callsite for observers & hooks authored by SpecificProtagonist
`ComponentHook` based Relationships authored by bushrat011899
Serialize and deserialize tuple struct with one field as newtype struct authored by notmd
Add more tools for traversing hierarchies authored by alice-i-cecile
Support using FilteredResources with ReflectResource. authored by chescock
Allow `World::entity` family of functions to take multiple entities and get multiple references back authored by ItsDoot
Add "bevy_input_focus" crate. authored by viridia
fix: Ignore window resized to `(0, 0)` events when minimizing window on Windows OS authored by ShoyuVanilla
Deprecate `get_or_spawn` authored by Trashtalk217
Add with_headers() method to RemoteHttpPlugin authored by spacemen0
Inverse bevy_render bevy_winit dependency and move cursor to bevy_winit authored by KirmesBude
Reduce compile time of bevy_ptr::OwnedPtr::make function authored by clarfonthey
Per-meshlet compressed vertex data authored by JMS55
Unified `Transform` blend stack authored by mweatherley
Issues Opened this week
Traits generated in the `Bundle` derive macro can trigger warnings authored by tim-blackbird
Feature gate `petgraph` in `bevy_reflect` authored by alice-i-cecile
Deferred rendering example is broken on web authored by DGriffin91
`QueryBuilder` is largely unusable due to keeping a reference to the `World` authored by djeedai
Meta-issue for improving reflect-deserialized asset loading authored by aecsocket
`spirv_shader_passthrough` must enable `wgpu/spirv` authored by BD103
Window close delayed when in `UpdateMode::Reactive` authored by hooded-shrimp
Vectorize application of morph weights authored by mweatherley
Remove `bevy_ui::Interaction` in favor of a `bevy_picking` based solution authored by alice-i-cecile
Add CORS header configuration for BRP `RemoteHttpPlugin` authored by villor
Add a mesh picking backend for `bevy_picking` authored by alice-i-cecile
The last lines of some of the text nodes in `text_debug` aren't shown. authored by ickshonpe
Reduce number of copies in the Mesh API authored by atlv24
Add trait ComponentConstructor authored by Qinka
Directional light does not disappear after removing the `DirectionalLight` component authored by tim-blackbird
Borders example is broken on some machines authored by Trashtalk217
Add a screen shake example authored by alice-i-cecile
`bevy_render` should not depend on `bevy_winit` authored by alice-i-cecile
Several examples appear broken following recent changes authored by alice-i-cecile
Removing `Parent` / `Children` from the world and then reinserting them can break hierarchies authored by alice-i-cecile
macOS: camera with shear not working authored by BenjaminBrienen
Add panoramic camera types authored by Bcompartment
Bevy icon improvements for smaller sizes and "scalability" authored by richchurcher
Add point cloud rendering example authored by Bcompartment
Add a unicode bidi example authored by richchurcher
Changes to textures does not propagate to materials authored by JoNil
Reduce Bevy's compiled binary size authored by alice-i-cecile
Add `EntityMut::get_mut_by_id_unchecked` authored by alice-i-cecile
Rename `AnimationGraph` to something like `BlendGraph` or `BlendTree` authored by mweatherley
Consider a rename of the `Pickable` component authored by tim-blackbird
Packaged as .app on the macOS platform, assets cannot be read. authored by mzdk100
Serialize with reflection is different from `serde` for tuple struct authored by notmd
Add more tools to conveniently work with hierarchies, especially in the presence of ghost nodes authored by alice-i-cecile
Animation Retargeting Woes authored by emberlightstudios
Hot-reload support for Bevy ECS systems authored by kaphula
Macro `detailed_trace` expects a `bevy_utils` module in scope when bevy reexport that module as `utils` authored by urben1680
More directly recommend `Commands`/`Query` `reborrow`ing when needing to pass to other functions. authored by ItsDoot
Adding utility math functions to GlobalTransform authored by Sigma-dev
Provide target-relative entity refs for observers authored by viridia
No method named `reborrow` found for struct `QueryIter` authored by C-Entropy
Consolidate view binding imports and positions authored by richchurcher
Bevy-native World Inspector authored by viridia
Add `Path` checking to `AssetReader` and/or `AssetServer` authored by RyanSpaker
Convert `HierarchyQueryExt` to use a `SystemParam` instead of an extension trait authored by alice-i-cecile
TextBundle should derive Clone authored by Jaso333
Improve access to animation curves and clips authored by mweatherley
Add `.contains_aabb` for `Frustum` authored by torsteingrindvik
`examples/ui/relative_cursor_position.rs` crashes if window is shrunk authored by shiki-saiki
Prefer iterator over Vec::push where it makes sense to authored by richchurcher
Bounds of text with mixed-size fonts is calculated incorrectly authored by alice-i-cecile