Shader Reflection, Inverse Kinematics, and the GMTK Jam
2024-08-26
This week we see some Bevy entries for the 2024 GMTK Jam, an inverse kinematic spider, and asset-driven shaders.
There are a number of different conversations happening at any given time and this week is no different, seeing some interesting WGSL thoughts and experiments in progress as well as more conversation around FixedTimestep
usage.
There was also some great conversation this week in #engine-dev around Bevy's target audience, feature set, RFC and working group processes, and more.
New utility methods on InfinitePlane3d
If you know you have points on an InfinitePlane3d
, you can choose to work in 2d instead of 3d (because its a plane) and sometimes this is even preferable depending on the algorithm you want to use. #14651 introduces a set of utility methods to project 3D points on a plane to 2D points and inject them back into 3D.
- signed_distance
- project_point
- isometry_into_xy
- isometry_from_xy
- isometries_xy
Allow ordering variable timesteps around fixed timesteps
In the ongoing community conversation around FixedTimestep
s, it came up that there was no clear schedule to update a camera's Transform
when using a FixedTimestep
. This is conceptually related to ordering data changes in relation to functionality like physics: In a frame, sometimes you want the physics systems to read data you've written, and sometimes you want to react to updates those physics systems have written.
#14881 introduces a new SystemSet
called RunFixedMainLoopSystem
which creates a more supported way to run logic once-per-frame (like Update
), and before or after fixed update logic.
The documentation included in this one is a great read if you're looking for additional context.
Some Thoughts on Bevy WGSL
There are a number of interesting efforts around WGSL happening including better tooling and a general desire to have a better future experience. None have working groups at the moment, but they spurred a GitHub Discussion "Some Thoughts on Bevy WGSL" in which @cart
makes some assertions and talks a bit about what a WGSL future should look like.
Its an interesting post if you're interested in working on future WGSL extensions.
Contributing
The Contributing Guide Collective working group has shipped new documentation on the website for onboarding new contributors.
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.
egui retained widget trees
showcase
Using a branch of bevy, this demo added retained widgets to egui. The work was driven by a need for a UI framework with text editing support, which egui provides.
The full sample code is available.
asset driven, reflection based shaders
showcase
video description: the source of a shader and javascript asset are both displayed. the javascript file contains a single function
shader_update
that is called each frame with a supplied variable shader, printing the js object's keys to the terminal's output. this value is built by introspecting the shader's ir via reflection and building an object that is supplied to the js runtime. edits to the shader produce a new layout which is dynamically applied to the material pipeline, creating new bindings on demand. see towards the end for introducing a new value on the js side that is instantly applied once the uniform is defined in the shader.
Inverse Kinematic Spider
showcase
This Spider is an inverse kinematic system crafted from scratch. Inverse Kinematics is the act of determining where the joints should be to achieve a desired end position.
One suggested crate in the Discord thread is k.
multiplayer RTS
showcase
An 8v8 (or 8 player FFA) multiplayer RTS game using bevy. Uses bevy_water, bevy_quill, and bevy_quinnet.
Terrain is randomly generated mesh and colors are added afterwards using WGSL shader. Assets are made using blender, for now they are just placeholders.
Architect of Ruin Menu
showcase
A new menu for Architect of Ruin: A Sword & Sorcery colony survival game centered on the reconstruction of an ancient ruined temple.
Crates
New releases to crates.io and substantial updates to existing projects
bevy_scene_postprocess 0.1.0
crate_release
A crate allowing you to post-process your scenes before they are spawned.
This is similar to bevy_scene_hook with one key difference: bevy_scene_hook waits until after the scene is spawned to do its actions, while bevy_scene_postprocess does its actions at load time. This also means you can spawn your scenes synchronously rather than only with a SceneBundle (which means deferring your mutations).
bevy_material_tool
crate_release
bevy_material_tool uses materials stored in a .gltf and a second .ron file to configure the materials. These materials can then used to replace all of the StandardMaterials attached to a mesh entity.
pyri_tooltip v0.1.1
crate_release
A tooltip crate built on bevy_ui
use pyri_tooltip::prelude::*;
app.add_plugins(TooltipPlugin::default());
commands.spawn((
NodeBundle::default(),
Interaction::default(),
Tooltip::cursor("Hello, world!"))
);
bevy_observed_utility
crate_release
bevy_observed_utility is ergonomic and correct Utility AI, powered by observers.
Features
- Minimal boilerplate: Add utility AI to pre-existing entities with little ceremony.
- Highly expressive: Build scoring hierarchies for whatever occasion, as complex or as simple as needed.
- Order-correct scoring: Hierarchies score their children before their parents.
- Familiar design: Reuses standard
Parent
/Children
hierarchy components to build actor entities that select actions based on their child score entities. - Pay-for-what-you-use performance: Scoring and Picking variants' observers are only registered when they're spawned for the first time.
- Game flow agnostic: Works well with both real-time and turn-based game simulation.
Educational
Tutorials, deep dives, and other information on developing Bevy applications, games, and plugins
Building a Bevy Plugin for Rolling Dice
educational
A post covering the author's adventure making custom dice and rolling them in Bevy.
Using the Mesh2d Depth Texture - Bevy Labs
educational
I had someone ask about the new 2d opaque depth buffer that was recently merged so I made a brief introductory video on it. I've also started labelling videos for features that are "merged, but not released, or experimental, like meshlets" as "labs" videos.
Fix commands not being Send / Sync in 0.14 authored by luca-della-vedova
New utility methods on `InfinitePlane3d` authored by RobWalt
Generalized `Into<AssetSourceId>` and `Into<AssetPath>` Implementations over Lifetime authored by bushrat011899
compile_fail_utils: Ignore `target` directory authored by MrGVSV
bevy_reflect: Function reflection terminology refactor authored by MrGVSV
Fix ecs example thread_rng duplicate creation authored by EdJoPaTo
catch asset loader panics authored by robtfm
Fix error when closing window in 2d_viewport_to_world example authored by ramon-bernardo
Remove useless `Direction` field authored by rparrett
Add conversions between Visibility and bool authored by Stanleeeeey
add docs explaining the two accesses of a System meta authored by cBournhonesque
Fix size of MeshVertexAttributeId to be platform independent authored by komadori
Fix key bindings in 3d_gizmos example after camera controller authored by mgi388
Added Documentation to `all_tuples_with_size` authored by bushrat011899
Revert "Add conversions between Visibility and bool (#14784)" authored by alice-i-cecile
Fix mesh2_manual exapmle. authored by tychedelia
Apply unused_qualifications lint authored by EdJoPaTo
check sampler type in as_bind_group derives authored by robtfm
Added Sprite::sized(custom_size) authored by Kees-van-Beilen
Clarify docs for `RenderLayers::layer` authored by rparrett
Expose bevy math ops authored by Lubba-64
Use lld for rustdoc on Linux in config_fast_builds.toml authored by roblesch
Implement `Reflect` for `std::ops::Bound` authored by Lubba-64
compile_fail_utils: Verify path exists authored by MrGVSV
Allow fog density texture to be scrolled over time with an offset authored by jirisvd
Add `filter_map_unchanged` to `Mut<T>` authored by ThomasAlban
Made the naming for commands parameter more consistent authored by WillTheCodeWork
Allow ordering variable timesteps around fixed timesteps authored by janhohenheim
Fix Gizmos warnings and doc errors when a subset of features are selected authored by therealbnut
Deprecate old contributing documentation / information authored by TrialDragon
Use quaternionic `smooth_nudge` in the `align` example authored by mweatherley
Update Grid Gizmo to use Color authored by therealbnut
Add helper methods on `Visibility` authored by ThomasAlban
Remove dead links to example code in the bevy_ecs README authored by wiggleforlife
Fix fog density texture offset seam authored by jirisvd
Use observers for removal detection in example authored by janhohenheim
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
drop pending asset loads authored by robtfm
Spectral Color Lighting authored by coreh
SystemParamBuilder - Support buildable Vec parameters authored by chescock
SystemParamBuilder - Enable type inference of closure parameter when building dynamic systems authored by chescock
SystemParamBuilder - Allow deriving a SystemParamBuilder struct when deriving SytemParam. authored by chescock
SystemParamBuilder - Support dynamic system parameters authored by chescock
Add methods to sample curves from `IntoIterator` types authored by RobWalt
Rewrite screenshots. authored by tychedelia
bevy_reflect: Add `Type` type authored by MrGVSV
Added `on_unimplemented` Diagnostic for `IntoObserverSystem` authored by bushrat011899
Replace the `wgpu_trace` feature with a field in `bevy_render::settings::WgpuSettings` authored by LikeLakers2
Improved text batching authored by ickshonpe
Add `AnimationGraph::from_clips` and simplify `animated_fox` example authored by rparrett
Simplify render_to_texture examples authored by IceSentry
Implement `std::fmt::Debug` for `ecs::observer::Trigger` authored by Sorseg
[Experimental] Runtime materials 👩🔬 authored by tychedelia
Initial implementation of the Bevy Remote Protocol (Adopted) authored by mweatherley
Add `Self: Sized` bounds to `Bundle` trait methods authored by jnhyatt
Add Order Independent Transparency authored by IceSentry
Split `GenericTypeCell::get_or_insert` into smaller pieces authored by bushrat011899
Picking event ordering authored by NthTensor
Have EntityCommands methods consume self for easier chaining authored by Luminoth
Make the field of `ParamSetBuilder` pub so it's actually usable. authored by chescock
Add World::trigger_ref and World::trigger_targets_ref authored by ItsDoot
Fix underflow panic in `InitTriInfo` authored by kumikaya
Refactor `AsBindGroup` to use a associated `SystemParam`. authored by tychedelia
Add flip convenience method to transform authored by Lubba-64
Issues Opened this week
Retrying a trigger authored by simbleau
Add support for auxiliary/fragment nodes in ui layouts and scenes authored by viridia
Use ThinColumn for both resources and sparse sets authored by alice-i-cecile
`FromWorld` should mention how it works with `Default` authored by MrGVSV
Improve ergonomics for single-section `Text`s authored by Olle-Lukowski
`AnimationPlayer` doesn't explain how it is created authored by aecsocket
Update/change fields of a reflected/dynamic type authored by DasLixou
Easy reflection type traversal utils authored by DasLixou
Better `Dynamic*` mutable iteration authored by DasLixou
`Slab not found` error when running the `loading_screen` example. authored by Olle-Lukowski
Allow Events to opt out of being targeted or untargeted for Observers authored by ItsDoot
TrackedRenderPass::set_vertex_buffer does not update if the size of sliced buffer changed authored by akimakinai
Make `HierarchyQueryExt` work with `QueryState` authored by DasLixou
multiple queries / SystemParam from `DeferredWorld` authored by DasLixou
Split up `TextSection` into separate components authored by ickshonpe
GenerateTangents in 0.14.1 can panic even though it is supposed to return Result authored by ethereumdegen
Should EntityCommands consume self? authored by Luminoth
Ruby text support authored by Kees-van-Beilen
Proposal: `color!` macro authored by Zeenobit
Relative Cursor Position demo : crash authored by XavDesbordes
Much of the `bevy_animation` functionality is only accessible through `bevy_animation::prelude` authored by LikeLakers2
World::trigger variant that takes a &mut impl Event authored by ItsDoot
Observer ordering/scheduling authored by Azorlogh
bevy::picking::events::Drop clashes with std::ops::Drop authored by ItsDoot
`ActiveAnimation::set_weight` doesn't return `&mut Self` authored by aecsocket
calloop warning authored by sofia-m-a
Bevy hot asset reloader decides to scan every file in project directory authored by sofia-m-a
Add automatic depth/shadow shaders for arbitrary materials authored by NthTensor