
Entity Relationships and Contact Projective Decals
2025-01-20
Relationships are the big Bevy feature dropping into the main branch this week. one-to-many relationships to be precise.
A community decals crate was also upstreamed and the Bevy Remote Protocol methods continue to grow.
In the showcases we feature GPU collision, flowfields, player controllers, procedural generation and more. While macros feature in the crates this week as bevy-butler and bevy_registration get releases.
one-to-many Relationships
Entity Relationships get a big step forward this week with #17298 introducing one-to-many non-fragmenting relationships. This simplifies relationship internals leading to improved performance and user experience.
Concretely this is a generic version of the Parent
/Children
components which can be implemented as such with the new APIs
#[derive(Component)]
#[relationship(relationship_target = Children)]
pub struct Parent(pub Entity);
#[derive(Component)]
#[relationship_target(relationship = Parent)]
pub struct Children(Vec<Entity>);
This opens up relationships; From being only Parent
/Children
components to being user-defined (or Bevy provided). This includes features like opting new relationships into "despawn descendants" behavior.
This work is foundational for the Next Generation Scene/UI effort and is the base for a number of followup features like improved spawning ergonomics and "many-to-many" relations.
If you want to check out the new features in action, go review #17443 which introduces a new example making use of Relationships.
Events are no longer Components
From an end-user perspective: Events aren't Components and you probably don't want to use them as Components (for example: Query<&MyEvent>
). This can make the Component
bound on Event
strange to read... but digging deeper yields a different story surrounding types like ComponentId
. #17380 removes the Component
bound without messing with the internals, allowing space for the continued evolution of those internals.
The details around this were part of the motivation for the It's All Components and Entities document which dives deeper into the nuance here.
bevy_contact_projective_decals upstreaming
#16600 upstreams naasblod/bevy_contact_projective_decals which in turn is based on Alexander Sannikov's talk about rendering in Path of Exile 2. (note: this talk also include Radiance Cascades).
The technique involves placing a decal on a quad which will then using the depth buffer to blender the decal with the geometry it intersects, as seen in the demo image. The implementation is surprisingly concise so if you're interested in rendering this is a great implementation to go read.
- AmbientLight is now a Component on a camera
- The Bevy Remote Protocol gained a method to mutate a Component
- Texture atlases are supported in custom cursors
cargo run --example custom_cursor_image
- A new run condition:
any_match_filter
that allows a system to run if theQueryFilter
has any results. Default
is now implemented forStateScoped

Showcase
Bevy work from the #showcase channel in Discord and around the internet. Use hashtag #bevyengine.

Physics-based character controller
showcase
An experimental physics based character controller with procedural animation that is strongly coupled to the physics

Hexroll's HTML content
showcase
HTML content rendered in hexroll with html5ever. The HTML is converted into bevy_ui for rendering.
Hexroll is a sandbox-generator and a virtual-table-top for old-school D&D.

Avian Caterpillar
showcase
A caterpillar built with Avian Physics. The red end has max friction and the blue end has min friction.

2d procedural world
showcase
A procedurally generated 2D chunk based world using Perlin noise, wave function collapse, and contextual layers.
Source is available on GitHub and a demo is available on YouTube.

Bevypunk video and audio synchronization
showcase
During an upgrade to 0.15, the Bevypunk example overhauled video and audio systems involving vleue_kinetoscope
and bevy_kira_audio
allowing them to stay synchronized even while playing in a loop and each track has different length.

Crates
New releases to crates.io and substantial updates to existing projects
bevy_prefs_lite 0.1.1
crate_release
bevy_prefs_lite provides basic preferences support for Bevy applications. The word "preferences" in this context is used to mean user settings that are
- set while running the app
- persistent across restarts
- implicitly saved.
It is not meant to be a general config file serialization mechanism. Preferences typically include things like:
- Current editing "mode" or tool.
- Keyboard or game controller bindings.
- Music and sound effects volume settings.
- The location of the last saved game.
- The user's login name for a network game (but not password!)
- "Do not show this dialog again" checkbox settings.

bevy_ios_safearea
crate_release
Bevy plugin that enables querying iOS device safe area insets (margins).
Features
- reads safe area on app start
- easy access via a resource
- noop on non-ios platforms (no
cfg
s needed in your app code)
bevy_fixed_update_task
crate_release
bevy_fixed_update_task provides a version of a Fixed timestep that doesn't block rendering, allowing game logic to take advantage of Bevy's async tasks to occur over multiple frames. This allows your logic to wait or speed up to catch up irrespective of rendering.
It may be useful to check out the examples in the GitHub repo.
bevy_webview_wry 0.1
crate_release
bevy_webview_wry provides an ipc-command, which allows you communicate between a Webview and Bevy process.
bevy-butler 0.4
crate_release
bevy-butler is a set of procedural macros aimed at reducing Plugin boilerplate and making systems more self-documenting by declaring system ordering and scheduling at the system declaration, rather than when they're added to an App.
Features
- Annotate systems with
#[system(plugin = MyPlugin, schedule = Update)]
to include them on a specified Plugin with a given Schedule - Seamlessly apply transformations within the system annotation:
#[system(plugin = MyPlugin, schedule = Update, after = previous_system, run_if(|| true))]
- Wrap multiple
#[system]
s in aconfig_systems! {}
block to set default attributes - Wrap multiple
#[system]
s in asystem_set! {}
to include them in an anonymous set, and apply set-level transformations likechain
- Seamlessy integrate into a user-defined
impl Plugin
block orstruct MyPlugin
statement by using the#[butler_plugin]
annotation - Transparently usable as a dependency in a library crate

Devlogs
vlog style updates from long-term projects
Rename `PickingBehavior` to `Pickable` authored by chompaa
Key render phases off the main world view entity, not the render world view entity. authored by pcwalton
Allow users to customize history length in `FrameTimeDiagnosticsPlugin` authored by rparrett
Fix entity does not exist message on index reuse authored by SpecificProtagonist
Renamed members of `ParamWarnPolicy` to reflect new behaviour. authored by AlephCubed
Higher quality bicubic lightmap sampling authored by JMS55
Rename UI `camera_entity` fields authored by ickshonpe
Downgrade `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` to `warn` authored by LikeLakers2
bevy_remote: Apply `#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
bevy_utils: Apply `#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
bevy_internal: Apply `#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
Feature gate `bevy_reflect` in `bevy_image`. authored by AlephCubed
bevy_picking: Apply `#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
Make InputFocus optional in bevy_winit authored by IceSentry
Add BRP method to mutate a component authored by purplg
Add some multi-span text to the `text2d` example authored by ickshonpe
Ambient component authored by robtfm
Refactor event system documentation in `system_param.rs` authored by younes-io
Use `multi_draw_indirect_count` where available, in preparation for two-phase occlusion culling. authored by pcwalton
bevy_core_pipeline: Apply `#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
bevy_macro_utils: Apply `#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
bevy_input_focus: Apply `#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
bevy_dylib: Apply `#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
bevy_ecs: Apply `#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` authored by LikeLakers2
Fix a missing `.entity() -> .target()` conversion in observers example authored by mweatherley
added `any_match_filter` common condition authored by Jaso333
Diagnostics smoothing factor fix authored by ickshonpe
`update_text2d_layout` creates new font atlases when the primary window is closed authored by ickshonpe
Add std derives to SystemParam types authored by spectria-limina
Fix `bevy_time` tests occasionally failing on optimised Windows builds authored by greeble-dev
Improve the `animated_mesh` example authored by greeble-dev
Make `ObservedBy` public authored by ad-kr
fix typo query.rs authored by younes-io
feat: support for clip children on windows authored by nicholasc
Fix some punctuation authored by bas-ie
Support texture atlases in CustomCursor::Image authored by mgi388
Create missing constructors for 2D primitive mesh builders authored by BD103
Implement `Clone` for `QueryIter` over read-only data authored by bushrat011899
Move `#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` to the workspace `Cargo.toml` authored by LikeLakers2
Forward decals (port of bevy_contact_projective_decals) authored by JMS55
Move CustomCursor to bevy_winit/src/custom_cursor.rs authored by mgi388
Add type registration for PickingInteraction authored by andrewhickman
Clip outlines using the local clipping rect. authored by ickshonpe
Remove Event: Component trait bound using a wrapper type which impls Component authored by alice-i-cecile
Use chain() for system dependency authored by cBournhonesque
Fix some `bevy_remote` typos authored by rparrett
Update safety docs for `Ptr::assert_unique` authored by JoJoJet
`add_edges` helper for directional navigation authored by alice-i-cecile
Add external assets to .gitignore authored by alex5nader
impl Default for StateScoped<S: Default> authored by JeanMertz
Add usage notes for the `IntoX` family of ECS traits authored by ItsDoot
Small improvements for directional navigation authored by alice-i-cecile
Relationships (non-fragmenting, one-to-many) authored by cart
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
Harden proc macro path resolution and add integration tests. authored by raldone01
Improve `bevy_ecs` inspectability and add debugging methods. authored by AlephCubed
`FromWorld` derive macro authored by ecoskey
Unify picking backends authored by chompaa
Add many_materials stress test authored by CrazyRoka
Change Camera.viewport_to_world_2d to rescale according to the rendering target's scaling factor authored by Suibeom
Fix docs mistake in bevy_ecs::world authored by berylllium
Reflect and register the wireframe materials authored by SludgePhD
Change `World::try_despawn` and `World::try_insert_batch` to return `Result` authored by JaySpruce
Composable Pipeline Specialization authored by ecoskey
docs: enhance documentation in `query.rs` to clarify borrowing rules authored by younes-io
Text 2d alignment fix authored by ickshonpe
Simplify usage of `EntityWorldMut::move_entity_from_remove` by making it a proper method authored by JaySpruce
Add `weak_handle!` convenience macro authored by SludgePhD
fix: limit the number of concurrent load_internal calls to avoid exce… authored by Braymatter
Remove `ViewVisibility` from UI nodes authored by ickshonpe
Rename `TargetCamera` to `UiTargetCamera` authored by ickshonpe
Make mocking picking events for bevy_ui easier authored by alice-i-cecile
Add basic debug checks for read-only `UnsafeWorldCell` authored by JoJoJet
Improve `TextSpan` docs authored by rparrett
Implement experimental GPU two-phase occlusion culling for the standard 3D mesh pipeline. authored by pcwalton
Renamed `PointerAction::Pressed` to `PointerAction::Button`. authored by AlephCubed
Correct 'Text2dBundle' to 'Text2d' in example comment authored by theotherphil
BRP Resource methods authored by mweatherley
Add docs to custom vertex attribute example authored by ChristopherBiscardi
Make the `animated_mesh` example more intuitive authored by greeble-dev
Fix rust-analyzer error in example bounding 2d authored by jiangheng90
Issues Opened this week
Asset Server silently fails when loading the wrong type authored by BR03D
DEFAULT_MAX_HISTORY_LENGTH is a bad default authored by alice-i-cecile
Thin Lines between grids in grid display (bevy UI) authored by DidItWork
Sprites sometimes not rendering when displayed along Mesh2d/MeshMaterial2d. authored by jingchan
Some of `bevy_ecs`' tests lint on `dependency_on_unit_never_type_fallback` authored by LikeLakers2
Main branch fails to compile on Rust beta. authored by github-actions[bot]
Text2d uses the scale factor of the primary window, not the scale factor of the render layer(s) it targets authored by ickshonpe
The `bevy_ecs::schedule::schedule` module shares its name with its parent module authored by LikeLakers2
`bevy_ecs::world::entity_ref::EntityWorldMut::take()`, a safe function, has an undocumented unsafe block authored by LikeLakers2
Input Rework authored by Kees-van-Beilen
Regression: rendered texture not updating after change to Image authored by bas-ie
`SpriteBatch`es can be overwritten in `prepare_sprite_image_bind_groups` authored by ickshonpe
The `bevy_ecs::system::system` module is linting `clippy::module_inception` authored by LikeLakers2
Deprecated bundles cause compiler warnings authored by Person-93
Bevy 0.15 no longer respects `Material2d::depth_bias` authored by SludgePhD
Bytes per pixel should be multiplied by width before calling align_copy_bytes_per_row authored by allenqm
Remove ambient light as a resource authored by alice-i-cecile
Camera clear_color does not work with multiple cameras authored by rectalogic
Automatically retry failed asset loads authored by alice-i-cecile
"Scheduled Events" over Events authored by Robsutar
Rename `bevy_picking::Location` to `bevy_picking::PointerLocation` authored by alice-i-cecile
Confusion about Reflectance vs. IOR with StandardMaterial authored by inodentry
UI nodes should ignore `RenderLayers` authored by ickshonpe
Rename PointerAction::Pressed to PointerAction::Button authored by alice-i-cecile
Allow required component initialization function to take in a reference to the source component authored by wentao
Setting a `TargetCamera` on a non-UI entity, or `RenderLayers` on a UI entity should be an error authored by ickshonpe
HashMaps don't include ReflectFromReflect authored by anlumo
SkinnedMesh doesnt work on a 2D setup authored by FloppyDisck
Rename `Parent` to `ChildOf` and `Children` to `ParentOf` authored by alice-i-cecile
Refactor `Component::init_component_hooks` to split apart component hook methods authored by alice-i-cecile
Some rust analyszer error in example bouding 2d authored by jiangheng90