
Occlusion Culling, Procedural Generation, and skyboxes
2025-02-24
This week in Bevy we see some nice ergonomic improvements to the defaults for Scene entity despawning, opt-in configuration for runtime validation of shaders, and occlusion culling in more places.
In the showcases, procedural generation ranks highly as always, with more landscapes and even spiral staircases.
And in the crate releases we see more attempts at better ergonomics though a revived bevy_skybox, new config loading, and generic materials.
Scene Entity Despawning
#17938 changes the behavior when despawning scene root instances.
The old behavior is recoverable by using SceneSpawner::despawn_instance()
, so this is a straightforward "pick which behavior you want" sort of change.
Configurable Checked Shaders
#17767 introduced unchecked shaders to Bevy, which increases performance since most shaders in a development pipeline are trusted code. Not all Bevy applications run trusted code, and recovering the ability to validate shaders for behavior like infinite loops is useful if you plan on running user-submitted shaders (like a Playground style application would).
#17824 makes this "checked" vs "unchecked" behavior configurable.
Occlusion Culling
Occlusion Culling skips the vertex and fragment shading for objects that are behind other objects (and therefore, guaranteed to not be visible. Occlusion Culling landed in #17413 and was extend to work on directional light shadow maps and the deferred rendering pipeline

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

Headless bevy_renet on k8s
showcase
The bevy_renet multiplayer example made headless, running in a container, and deployed to Kubernetes.

Procedural Tree Generation
showcase
Procedural tree generation that you can play with on the web, showing contours and triangles or generating new trees.

Greedy Meshing
showcase
A fork of Tantan's greedy meshing repo, this project updates to Bevy 0.15, works on de-hardcoding the block types, and adds transparency.

Student Tank Battles
showcase
An educational tool for students to learn Java, data structures and algorithms.
The game runs on a Rust server with Bevy handling the game logic. It supports multiple lobbies, allowing several matches to run simultaneously with players and spectators. There is also a spectator client in Bevy that connects to the server, receives game state updates, and renders them in real time.
The students get to program their own bots by writing Java-based AI for tanks, using a custom library that was built to handle all the networking. Their focus will be on strategy. navigating, targeting, and outmaneuvering opponents to win.


font sizes and observers
showcase
A showcase of bevy_html_lite behaviors including font sizing and observers.

2d colonist simulator prototype
showcase
An early prototype of grid-based pathfinding for a 2d colonist simulator game in the style of Rimworld/Dwarf Fortress.
The implementation features box selection, right mouse button click and drag, and avoiding obstacles en route - though the units don't avoid overlapping each other yet.

Torp: Moving Objects
showcase
The player can now move objects from one spot to another. Moving objects have a chance to break, which reduces with citizen skill.


Noumenal
showcase
Raytraced smooth surfaces for noumenal, including correct depth for rounded shadows. The images showcase switching between flat shading to show the difference at low detail.

Spherical Harmonics Demo
showcase
A demo for the MountainBytes demoparty, rendering an oscillating shape made of spherical harmonics by passing coefficients with a storage buffer.
A video of the session is on YouTube and the source code is available on GitHub

Crates
New releases to crates.io and substantial updates to existing projects

bevy_skybox
crate_release
bevy_skybox existed before Bevy's skyboxes did. Now its being revived on top of Bevy's skyboxes as a quick and dirty way to take a skybox net you found an image of somewhere and use it to make your prototypes prettier.

bevy_animation_graph 0.6
crate_release
bevy_animation_graph is a third party animation library for Bevy implementing UE5-style animation graphs, and which comes with an egui-based editor.
0.6 introduces dynamic animation node registration, which allows you to create your own animation nodes by implementing the NodeLike
trait, better debugging tools, new nodes, and more.
bevy_dyn_component
crate_release
Bevy supports dynamic components, or components created and registered at runtime instead of statically by implementing the Component
trait. This includes guarantees you need to uphold with unsafe
. bevy_dyn_component
crate incurs a small amount of runtime overhead to track this for you. It works by registering a new dynamic component patterned after an existing one, and then ensuring that you're always using the correct pattern to interface with it.
#[derive(Component)]
struct Template;
// `marker0` is now a new component with
// the same layout as `Template`
let marker0 = world.dynamic_component::<Template>();
// `my_entity` now has a `marker0` component on it!
let my_entity = world
.spawn(())
.insert_dynamic(marker0, Template)
.id();
// This is essentially `Query<(), With<marker0>>`
let mut query = QueryBuilder::<()>::new(world)
.with_id(marker0)
.build();
let with_marker0 = query.iter(world);
// Make sure our query is picking up the right entities:
assert_eq!(with_marker0.next(), Some(my_entity));
assert_eq!(with_marker0.next(), None);
bevy_materialize
crate_release
A crate for loading, storing, and applying type-erased materials in Bevy.
GenericMaterial3d(asset_server.load("materials/example.toml"))

bevy_trenchbroom v0.6
crate_release
A TrenchBroom (Quake level editor) and now ericw-tools (Quake level compiler) integration for Bevy, able to load .map and .bsp files.
0.6 brings a massive API overhaul, bsp support, lightmap and irradiance volume animation via compute shaders, and a better material system (via bevy_materialize)
Bevy Config Stack v0.1.0
crate_release
A configuration plugin for Bevy. Load ron files and store them as Resources for access.

Devlogs
vlog style updates from long-term projects


To Build a Home
devlog
The fourth devlog of To Build a Home, the upcoming 2D life simulator inspired by the Sims and Dwarf Fortress. This time we talk about characters having responsibilities, from watering plants to going to work.
Add `EntityDoesNotExistError`, replace cases of `Entity` as an error, do some easy Resultification authored by JaySpruce
Fix panic in `custom_render_phase` example authored by rparrett
Replace `BufferVec<PreprocessWorkItem>` with `RawBufferVec<PreprocessWorkItem>`. authored by pcwalton
Don't delete the buffers that batch building writes into every frame. authored by pcwalton
Move implementations of `Query` methods from `QueryState` to `Query`. authored by chescock
Support using FilteredResources with ReflectResource. authored by chescock
Bump `typos` to 1.29.7 authored by rparrett
Sweep old entities from 2D binned render phases authored by superdump
Fix typos CREDITS.md authored by axlitEels
Fixed `bevy_image` and `bevy_gltf` failing to compile with some features. authored by AlephCubed
Fix `dds` feature enabling `bevy_gltf` authored by rparrett
Improve the docs for ChildOf and Children authored by alice-i-cecile
Add option to animate materials in many_cubes authored by DGriffin91
Don't mark newly-hidden meshes invisible until all visibility-determining systems run. authored by pcwalton
Fix motion vector computation after #17688. authored by pcwalton
Make the specialized pipeline cache two-level. authored by pcwalton
Retain skins from frame to frame. authored by pcwalton
Split out the `IndirectParametersMetadata` into CPU-populated and GPU-populated buffers. authored by pcwalton
Implement occlusion culling for the deferred rendering pipeline. authored by pcwalton
Rewrite the multidrawable batch set builder for performance. authored by pcwalton
Fix false positive GPU frustum culling authored by mate-h
Shader validation enum authored by fjkorf
Use global binding arrays for bindless resources. authored by pcwalton
Remove unused `#[must_used]` authored by bushrat011899
Fix issue with `define_label!` instantiation in a 3rd party crate authored by ItsDoot
Implement occlusion culling for directional light shadow maps. authored by pcwalton
Reallocate materials when they change. authored by pcwalton
Reextract a mesh on the next frame if its material couldn't be prepared on the frame we first encountered it. authored by pcwalton
Fix bugs in the new non-bindless mesh material allocator. authored by pcwalton
Enable `nonstandard_macro_braces` and enforce `[]` for `children!` authored by BD103
Fix 1x1 dds textures being interpreted as 1-dimensional authored by rparrett
Use fully qualified syntax in assertions. authored by DragonGamesStudios
Only despawn scene entities still in the hierarchy 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
Allow prepass to run without ATTRIBUTE_NORMAL authored by terahlunah
Bubble sync points if `ignore_deferred`, do not ignore if target system is exclusive authored by urben1680
Add `uv_transform` to `ColorMaterial` authored by hukasu
`Node::transform` field authored by ickshonpe
Unrequire `VisibilityClass` from `Node` authored by ickshonpe
Parallelize prepare_assets::<T> systems authored by brianreavis
Update smol_str requirement from 0.2 to 0.3 authored by mnmaita
Anonymous ghost nodes authored by ickshonpe
Implemented `ComputedNode.logical_size()` method, returns node size after accounting for window scale authored by bsibb22
Change ChildOf to Childof { parent: Entity} and support deriving Relationship and RelationshipTarget with named structs authored by Bleachfuel
`GhostNode` trait authored by ickshonpe
Add byte information to `PositionedGlyph` authored by bytemunch
Fix NonMesh draw command item queries authored by brianreavis
Added top level `reflect_documentation` feature flag. authored by AlephCubed
Add `http` & `https` asset sources (clean commit history) authored by mrchantey
Make CursorGrabMode a State authored by Atlas16A
Add AnnularSector primitive shape authored by RJ
`ComputedNodeTarget` improvements authored by ickshonpe
`extract_text_shadows` camera query fix authored by ickshonpe
`many-cameras` option for `many_buttons` authored by ickshonpe
do_not_recommend interned Labels authored by SpecificProtagonist
Fix observer/hook OnReplace and OnRemove triggering when removing a bundle even when the component is not present on the entity authored by andriyDev
Make `Parallel<T>` more `T: !Default` accessible authored by ItsDoot
Incorporate OIT into MeshPipelineKey used by the LineGizmoPipeline authored by mweatherley
Fix bug in bevy_reflect serde deserialzie: OptionVisitor does not set index, when deserialzing Some authored by richterger
implement UniqueEntityArray authored by Victoronz
Add support for experimental WESL shader source authored by tychedelia
Add `no_std` support to `bevy` authored by bushrat011899
Prevent last_trigger_id from overflowing authored by OwlyCode
Fix unsound query transmutes on queries obtained from `Query::as_readonly()` authored by chescock
Material, mesh, skin extraction optimization authored by brianreavis
Text cursor authored by ickshonpe
Generic system config authored by newclarityex
Add a new `#[data]` attribute to `AsBindGroup` that allows packing data for multiple materials into a single array. authored by pcwalton
Upgrade to Rust Edition 2024 authored by bushrat011899
Remove unnecessary bounds on `EntityClonerBuilder::without_required_components` authored by JaySpruce
Improve relationship attribute macro syntax authored by Olle-Lukowski
Fix unsound lifetimes in `Query::join` and `Query::join_filtered` authored by chescock
Add gram-schmidt fast approximation tangent generation algorithm authored by aloucks
Issues Opened this week
2d specialized material shader defs aren't updated authored by rparrett
Calling despawn_recursive() despawns entities that are no longer descendants authored by matjlars
Add `FilteredWorld(Mut)` authored by Shatur
Loading certain GLTF assets causes extreme lag authored by ethereumdegen
Validation error when trying to run full screen authored by DragonGamesStudios
Required components cannot be registered just with ComponentIds authored by anlumo
`print_ui_layout_tree` is exported, but not usable authored by rparrett
All observers triggered when any element of a bundle is removed. authored by andriyDev
Make `ChildOf` a named struct and support named struct `Relationship` types authored by alice-i-cecile
Support Volumetric Clouds authored by lomirus
`Image::from_buffer`'s public signature changes if debug assertions are enabled authored by rparrett
Support asynchronous Picking backends authored by ThomasVille
Docs for `resource_changed` and related run conditions are misleading authored by rparrett
bevy_remote add resource request authored by 1ADIS1
Using OIT and gizmos together panics authored by mweatherley
Interaction state not resetting after switching window modes authored by sroauth
Implement the Iterator trait for Image authored by homebrewmellow
Remove "relationship" stutter in relationship attribute macro authored by dmyyy
GPU Animation and Vertex Animation authored by w2moon
Upgrade to Rust edition 2024 authored by andriyDev
Upstream bevy_framepace authored by IceSentry
Intersperse text and images authored by ickshonpe
Subasset Aliases authored by andriyDev
Change #[derive(Debug)] to manual impl for certain bevy_ptr types authored by mysteriouslyseeing
`specialized_mesh_pipeline` and `custom_shader_instancing` examples are broken authored by rparrett
Add cached matrix operations to `Camera`. authored by mintlu8
Add a Dir4 authored by ElliottjPierce
Tuples don't get `ReflectFromReflect` type data registered in `GetTypeRegistration` authored by makspll