Async Assets, Mesh Picking, and The Bevy Linter
2024-10-21
The first release candidate gets closer this week as it seems like the Required Components migrations are nearing their completion and various bug fixes have made their way in.
The 0.15 milestone can be viewed on GitHub and includes work like an upgrade to wgpu 23 some of which will happen over the course of the release candidates.
In the meantime we've got plenty of PRs to cover and community showcases to explore.
Async Assets
Bevy's asset system is async by nature but is most often used in sync contexts, such as in a Bevy system. #15913 adds a method for asynchronously waiting for an asset to load. This makes it easier to use in contexts that integrate well with async, like in Bevy's async tasks. The new method AssetServer::wait_for_asset
returns a future that suspends until the asset associated with a given Handle
either finishes loading or fails to load.
Required Components
In #15898 bevy_ui was ported to Required Components and in #15975 the Style
fields were merged into Node
, paving the way for future improvements in bevy_ui's approach to styles.
SpatialBundle deprecation
SpatialBundle
has been deprecated in #15830 as part of the Required Components work and usages have been replaced with the Transform
and Visibility
components, which both bring along their required components.
before
commands.spawn(SpatialBundle::default());
after
commands.spawn((Transform::default(), Visibility::default());
Observers
#15811 introduces the Trigger::components
method, which allows observers to know which components trigger them.
Batch insert
#15702 introduces a few new APIs for inserting a batch of new entities.
World::insert_batch
World::insert_batch_if_new
World::try_insert_batch
World::try_insert_batch_if_new
Commands::insert_batch
Commands::insert_batch_if_new
Commands::try_insert_batch
Commands::try_insert_batch_if_new
use bevy_ecs::{entity::Entity, world::World, component::Component};
#[derive(Component)]
struct A(&'static str);
#[derive(Component, PartialEq, Debug)]
struct B(f32);
let mut world = World::new();
let entity_a = world.spawn_empty().id();
let entity_b = world.spawn_empty().id();
world.insert_batch([
(entity_a, (A("a"), B(0.0))),
(entity_b, (A("b"), B(1.0))),
]);
assert_eq!(world.get::<B>(entity_a), Some(&B(0.0)));
Curves
What are curves? well now there is documentation so you too can find out what they are and how to use them.
Picking
The new bevy_picking crate already supports UI and Sprite picking and #15800 brings mesh picking to the supported backends. This also brings support for performing ray casts on meshes.
The Bevy Linter
The bevy_cli working group has been developing a linter specifically for Bevy programs. As of this issue, the 5th lint has been created: A lint that warns against components, resources, and events that do not implement Reflect
, which is functionality used by a variety of programs including bevy_inspector_egui.
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.
Molecular visualizer PoC
showcase
A molecular visualizer proof of concept. It visualizes linear alkanes specifically, that is chains of carbons with hydrogens.
Velyst
showcase
A tracing animation using Velyst, an Interactive Typst content creator using Vello and Bevy. Reminiscent of a "Hold to interact" pattern.
PvP boxing
showcase
The first player vs player fight in this boxing game. The physics are handled by PhysX.
Crates
New releases to crates.io and substantial updates to existing projects
Voxy
crate_release
A new voxel engine for Bevy with high performance meshing. You can now easily load in .vox files with lighting and emissive materials
space_editor 0.6
crate_release
space_editor is a editor for scenes and prefabs for bevy engine. It allows you to create/modify/save/load levels and prefabs in a GUI based way. space_editor 0.6 brings Bevy 0.14 support, a new pretty ui, and more.
bevy_ui_inspector
crate_release
the initial version of a chrome devtools like inspector for bevy ui.
Add `insert_batch` and variations authored by JaySpruce
use previous ubuntu version for example validation authored by mockersf
fix spatial audio examples authored by awtterpip
split up `TextStyle` authored by ickshonpe
Filter UI traversal to only Node and GhostNode authored by villor
Improve `PhantomData` held by curve adaptors authored by mweatherley
Implement `WorldQuery` for `MainWorld` and `RenderWorld` components authored by alice-i-cecile
Migrate from `Query::single` and friends to `Single` authored by pablo-lua
Deprecate SpatialBundle authored by NiseVoid
Add mesh picking backend and `MeshRayCast` system parameter authored by Jondolf
Time<Real> documentation improvement authored by BenjaminBrienen
`spirv_shader_passthrough` must enable `wgpu/spirv` authored by BenjaminBrienen
screenshot comparison: fix upload for macOS... again authored by mockersf
Compare screenshots with main on PRs authored by mockersf
Remove incorrect equality comparisons for asset load error types authored by BenjaminBrienen
Fix screenshot comparison authored by mockersf
screenshot comparison: prepare macos folder in the expected format by upload-artifact action authored by mockersf
Fix *most* clippy lints authored by clarfonthey
Alternative fix for `mesh2d_manual` example authored by rparrett
force last update after setting state to Suspended authored by mockersf
[bevy_ui/layout] Add tests, missing asserts, and missing debug fields for UiSurface authored by StrikeForceZero
Fix overflow panic on Stopwatch at Duration::MAX authored by mirsella
Despawn unused light-view entity authored by akimakinai
don't clip text that is rotated authored by mockersf
Make `contributors` example deterministic in CI authored by rparrett
Move `SUPPORTED_FILE_EXTENSIONS` to `ImageLoader` and remove unsupported formats. authored by andriyDev
Add `Trigger::components`, which lists the component targets that were triggered authored by ItsDoot
Clip to the UI node's content box authored by ickshonpe
bevy_reflect: get_represented_kind_info APIs for reflected kinds authored by torsteingrindvik
Infer `StableInterpolate` on tuples authored by mweatherley
Text Rework cleanup authored by MiniaczQ
Fix panic due to malformed mesh in `specialized_mesh_pipeline` authored by rparrett
Validate param benchmarks authored by MiniaczQ
Move `ImageLoader` and `CompressedImageSaver` to `bevy_image`. authored by andriyDev
Add module-level docs for Curve authored by mweatherley
[Adopted] Add a method for asynchronously waiting for an asset to load authored by bushrat011899
Fix `detailed_trace` module scope authored by BenjaminBrienen
Attempt to remove component from render world if not extracted. authored by tychedelia
Revert default mesh materials authored by Jondolf
Add window drag move and drag resize without decoration example. authored by shanecelis
UI materials: don't reserve in loop when enough capacity authored by mockersf
Overflow clip margin authored by ickshonpe
Fix asset_settings example regression authored by rafalh
register `TextFont` and `TextColor` in app type registry authored by atornity
Visual improvements to `log_layers_ecs` example authored by rparrett
Remove `bevy_ui`'s "bevy_text" feature authored by ickshonpe
Add shadows to `ui` example authored by ickshonpe
Default UI shadow samples fix authored by ickshonpe
Introduce testbed examples starting with 2d authored by mockersf
Update label used for breaking changes authored by alice-i-cecile
aligning public apis of Time,Timer and Stopwatch authored by andristarr
Add read-only access to `PointerInteraction` authored by tim-blackbird
Mark ghost nodes as experimental and partially feature flag them authored by alice-i-cecile
Remove write access to `ConvexPolygon.vertices` authored by lynn-lumen
Fix typos from greyscale -> grayscale authored by mgi388
Use `#[doc(fake_variadic)]` on `StableInterpolate` authored by bash
Remove `ExtractComponent::Out` authored by akimakinai
Improve and Debug CI `compile-check-no-std` Command authored by bushrat011899
Delete `ImageLoader::COUNT` in favour of `ImageLoader::SUPPORTED_FORMATS.len()`. authored by andriyDev
Fix `bevy_color` not compiling standalone. authored by andriyDev
Migrate UI bundles to required components authored by VitalyAnkh
Adjust some example text to match visual guidelines authored by rparrett
Improve API for scaling orthographic cameras authored by alice-i-cecile
Remove AVIF feature authored by clarfonthey
Fix `pbr` example camera scale authored by rparrett
Merge Style properties into Node. Use ComputedNode for computed properties. authored by cart
Fix lightmaps break when deferred rendering is enabled authored by Soulghost
Fix `animation_masks` example's buttons authored by rparrett
examples(shaders/glsl): Update GLSL Shader Example Camera View uniform authored by jakeswenson
Fix OIT depth test authored by IceSentry
OIT style tweaks authored by cart
Remove components if not extracted authored by akimakinai
Resolve unused_qualifications warnings authored by akimakinai
Testbed for 3d authored by mockersf
Optional UI rendering authored by ickshonpe
Add docs for how to manually add a `WinitPlugin` to a `MinimalPlugins` setup. authored by Elabajaba
Fix deactivated camera still being used in render world authored by rafalh
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_winit(emit raw winit events) authored by HugoPeters1024
Disjoint `QueryData` access authored by vil-mo
Make `tracing` Optional for `bevy_utils` authored by bushrat011899
Meshlet builder improvements redux authored by JMS55
Allow users to choose how `EntityCommands` should fail if the entity is missing authored by JaySpruce
Add more tools for UI tree traversal authored by villor
Create enumerating version of `all_tuples` authored by mweatherley
Observers to log debug message when no observers found for event type… authored by andristarr
Meshlet fill cluster buffers rewritten authored by JMS55
Export `Val` Variants authored by bushrat011899
Double MAX_JOINTS and MAX_MORPH_WEIGHTS authored by victorb
Refactor `GltfLoader::load_gltf` authored by hukasu
Upgrade to wgpu 23 authored by tychedelia
Polygon simplicity authored by lynn-lumen
Mesh::deduplicate_vertices authored by stepancheg
Add `RenderComponent` trait for transient render world marker components authored by tychedelia
Support prefers_home_indicator_hidden authored by Soulghost
Added `PressedButtons` to `PickingInteraction::Pressed`. authored by mintlu8
Issues Opened this week
Hovering entity in game authored by itsmeagainlamo
Migrate UI bundles to required components authored by alice-i-cecile
`bevy_text` feature gating for `bevy_ui` doesn't seem to work authored by ickshonpe
`scene_viewer` example prints warnings after toggling shadow on and off authored by akimakinai
Spawning many different 2d or 3d materials hangs for minutes or crashes authored by DGriffin91
`specialized_mesh_pipeline` example has wrong colors half the time authored by rparrett
Buffer types + arrayLength() issues authored by JMS55
Reporting rendering regression on PRs authored by mockersf
Call redraw while resizing windows authored by alice-i-cecile
Add Val helper functions authored by alice-i-cecile
`asset_settings` example emits error and doesn't render one sprite authored by rparrett
Reading malformed DDS file is a panic instead of an error result authored by zbx1425
Log when an event was triggered but no observer consumed it authored by ItsDoot
iOS build crashes on camera pan authored by kraftwer1
Teach users how to control how noisy Bevy's logging is authored by alice-i-cecile
Directional lights and spot lights do not have shadow on WebGL on chromium. Shader compilation failed on Firefox. authored by newDINO
Move `all_tuples` and friends into its own crate authored by bushrat011899
Remove `bevy_image` re-exports from `bevy_render` authored by andriyDev
Document why MAX_JOINTS and MAX_MORPH_WEIGHTS are set authored by alice-i-cecile
Vertically-centered text is too low authored by viridia
Adoption of JoJoJet/bevy-trait-query authored by Inspirateur
Improve documentation on how to setup and run Tracy authored by wilk10
Asset processing causes UiImage to panic authored by Tam
Remove indices from Mesh and into NewType authored by hukasu
TextSpan can not recieve Pointer<Click> events authored by rewin123
Picking: Filter keys in `PickingInteraction` authored by mintlu8
Specify policy on panics in the Bevy repo. authored by tbillington
Label the command encoder of the `RenderContext` authored by djeedai
Trying to iterate &Res<Assets<T>> results in a poor compiler error authored by JMS55
webgpu: `3d_scene` example panics authored by rparrett
webgl2: `3d_scene` example panics authored by rparrett
Add a method to bulk insert/remove components in a single archetype move authored by ItsDoot
cosmic_text Query re-export degrades autocomplete UX authored by alice-i-cecile