Rumblings of 0.14, God Rays, and Depth of Field
2024-05-20
Bevy 0.14's release cycle is just getting started with the creation of the 0.14 release crew working group (discord link to working group). Alice talked a bit about the creation of the group and what its trying to do over on Mastodon).
There is now a milestone for the release that Alice covered in depth, so check it out if you're interested in what's left to do for 0.14.
In the meantime, here's what else has been happening this week.
Cone Meshing
The Cone primitive got meshing support. Notably this includes UV coordinates that are polar, so textures are applied as if looking at the Cone from above.
Rounded Box Gizmo
A new Gizmo was created for 2d and 3d rounded boxes. Both of which support modifying the corner/edge radius as well as the arc segments.
Depth of Field
Depth-of-field (also known as that blurry effect cameras have when focusing) was added as a new post-processing effect. This includes two different kinds: hexagonal bokeh and Gaussian blur. The PR for this one is again, super informative so I highly suggest reading it.
To use depth of field, add DepthOfFieldSettings
to an entity containing a Camera3d
component.
God Rays (volumetric fog and lighting)
God rays (or light shafts) are best explained by the images above. This occurs when light shines through volumetric fog, which is exactly what #13057 implements.
This PR introduces two new components: VolumetricFog
and VolumetricLight
. VolumetricLight
is applied to directional lights which allows them to interact with VolumetricFog
.
Blender/Bevy Workflows
Work is continuing to enhance Blender-and-Bevy workflows in an as-yet-unamed crate. The current plugins are available on GitHub.
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.
Project Harmonia: Snapping
showcase
Placing furniture with float coordinate positioning can be tough, so why not implement a Component that allows the sides of objects to "snap" onto other entities with the same Component?
Slavic Castles Card Game
showcase
Slavic Castles is a card game that we saw last week and this week we get the full source code, including usage of bevy_ecss
, bevy_pkv
and more.
Wiggly Grace
showcase
wiggly grace is a demo of visual audio generation, so click through to hear it.
Source is available on GitHub with some instructions in the Discord thread.
Powerup menu
showcase
A proof of concept for a Power-up menu. One really interesting part of the PoC is that it is fully localizable by taking advantage of Fluent and a custom crate.
Powerups are Component
s that get attached to the player's Entity
when chosen. Interesting aspects of this approach include storing OnHit
components which themselves contain Component
s. When that Entity
gets hit, it inserts a copy of the Component
in OnHit
onto the target.
Fluent is a localization system with an implementation in Rust
HackeRPG: Playable via YouTube Chat
showcase
This game demo was run on YouTube, allowing chatters to come in and decide what happens by taking advantage of 12 different possible commands. You can see a command log in the upper right hand corner and see the chat on the YouTube video match up.
Sand Snake
showcase
One of the really awesome ways in which Bevy exists is how modular it is, and one of the most commonly used crates outside the "A Bevy App" use case is bevy_ecs
.
This YouTube video showcases a project that uses bevy_ecs to power a "pixel simulated version of the classic snake game". This kind of game is often referred to as a "falling sand game".
Available on Itch.io
Crates
New releases to crates.io and substantial updates to existing projects
bevy_ios_iap release
crate_release
Provides access to iOS native StoreKit2 Swift API from inside Bevy Apps.
Features
- fetch products
- purchase products
- listen to changes in transaction states (pending -> purchased, finished)
- fetch list of all transactions (to restore old purchases of non-consumables or active subscriptions)
bevy-tnua 0.18
crate_release
bevy-tnua is a floating character controller, which means that instead of constantly touching the ground the character floats above it, which makes many aspects of the motion control simpler.
The major change in 0.18 is the addition of a max_slope
parameter, which can be used to prevent the character from walking on ground that is too steep.
bevy-2dviewangle
crate_release
bevy-2dviewangle
uses events and custom macros to enable the ergonomic storage and usage of multi view angle spritesheets.
#[derive(ActorsTexturesCollection, Default)]
struct MyAssets {
#[textureview(
actor = "player",
action = "idle",
angle = "front"
)]
pub idle_front: Handle<Image>,
// If not specify actor/action, the previous value
// will be used
#[textureview(angle = "back")]
pub idle_back: Handle<Image>,
// If the angle "right" is not defined, it will
// be flipped base on the "left" image
#[textureview(angle = "left")]
pub idle_left: Handle<Image>,
// If angle is any, other angle which has not been
// defined will use this value
#[textureview(angle = "any")]
pub idle_any_layout: Handle<TextureAtlasLayout>,
}
// Change the sprite sheet by sending event
fn switch_sprite(
mut actors: Query<(&mut DynamicActor, Entity)>,
mut action_event: EventWriter<ViewChanged>,
) {
for (mut act, e) in actors.iter_mut() {
act.action = Action::Idle;
act.angle = Angle::Right;
action_event.send(ViewChanged { entity: e });
}
}
dbg_if v0.1
crate_release
This crate isn't Bevy-specific, but was built to work on Bevy Apps. It provides additional dbg!
macros to make it easier to debug things in the loop:
dbg_once!
print once (bevy hasdebug_once!
which has more functionality)dbg_if_ne!
print if not equal to last value (for atomic types)dbg_if_hash_ne!
print if hash not equal to last value (forHash
types)
bevy_quinnet 0.8
crate_release
Bevy Quinnet's 0.8 update adds replicon integration via the bevy_replicon_quinnet
crate.
Devlogs
vlog style updates from long-term projects
Reimagining Astortion: Devlog 0
devlog
Astortion is a metroidvania 2d puzzle platformer game that started life in 2020 and recently reset development with more concrete goals.
The devlog includes discussion of game mechanics as well as Blender integration designing splines in Blender and bringing them into Bevy. The developer calls out Bevy's asset system, and hot-reload specifically, as being a huge workflow improvement over their previous iteration and say they intend to go deeper into this topic in their next video.
You can wishlist Astortion on Steam
Educational
Tutorials, deep dives, and other information on developing Bevy applications, games, and plugins
Drag and Drop player-built LDtk levels
educational
Bevy supports Drag and Drop files natively using an Event. We can take advantage of this and other crates in the ecosystem like bevy_ecs_ldtk
to enable players to build their own levels using LDtk and drop them onto the app to play them using the game logic we've provided.
Source is available on GitHub
Add copy, clone, and debug derives to cubic spline structs authored by aristaeus
Make `bevy_time` optionally depend on `bevy_reflect` authored by juliohq
Fix `asset-source-website.patch` line number authored by BD103
Fix incorrect workgroupBarrier and OOB array access in auto_exposure authored by Kurble
remove unused warnings in release authored by mockersf
headless_renderer comments typo fix authored by ChristopherBiscardi
Add doc comments explaining the different behaviours of `alignment` and `Anchor` with `text_2d` authored by ickshonpe
Update release workflow pr body authored by Brezak
Improve tracing layer customization authored by cBournhonesque
Fix motion blur on wasm authored by rparrett
bevy_asset: Add missing web-sys feature and cleanup unused ones authored by snendev
Ensure clean exit authored by tychedelia
Avoid bevy_reflect::List::iter wrapping in release mode authored by rmsthebest
State example authored by moonlightaria
Add meshing for `Cone` authored by Jondolf
Implement fast depth of field as a postprocessing effect. authored by pcwalton
Determine msrv for every standalone bevy_* crate. authored by Brezak
Add `cargo ci` alias for `ci` tool authored by BD103
Add docs for `PointLight` authored by jnhyatt
constrain WorldQuery::get_state to only use &Components authored by Victoronz
Apply uv transform in the prepass authored by DGriffin91
Add UV channel selection to StandardMaterial authored by geckoxx
Implement Color Operations for `Color` authored by bushrat011899
Implement `WorldQuery` and `QueryData` on `Mut`. authored by Themayu
Skip redundant mesh_position_local_to_world call in vertex prepass shader authored by AmionSky
Fix UI border artifacts caused by incorrect blending authored by floppyhammer
Misc asset code quality and docs authored by JMS55
Fix ClearColor in 2d pipelines authored by pietrosophya
example render_to_texture: remove extra light authored by mockersf
Use `load_with_settings` instead of manually overriding srgbness in examples authored by rparrett
Remove unnecessary .view_layouts authored by IceSentry
Implement volumetric fog and volumetric lighting, also known as light shafts or god rays. authored by pcwalton
Add reflect impls for bevy_math curve structs authored by aristaeus
Enable depth of field on webgpu authored by IceSentry
Allow shapes to be constructed with zero values authored by juliohq
Add `Debug` derive for `ScreenSpaceAmbientOcclusionSettings` struct authored by Xzihnago
Revert "Support calculating normals for indexed meshes" (#12716) and add support for calculating smooth normals authored by adithramachandran
Fix transmission by setting the correct value for transmissive_lighting_input.F_ab authored by geckoxx
Add Rounded box gizmos authored by solis-lumine-vorago
#12502 Remove limit on RenderLayers. authored by tychedelia
Add `on_unimplemented` Diagnostics to Most Public Traits authored by bushrat011899
Revert "Add `on_unimplemented` Diagnostics to Most Public Traits" authored by alice-i-cecile
Add emissive_exposure_weight to the StandardMaterial authored by geckoxx
De-clutter `2d_gizmos` example authored by rparrett
Make the prepass shader compile when lightmaps are present. authored by pcwalton
fix normals computation for gltf authored by mockersf
Common `MeshBuilder` trait authored by solis-lumine-vorago
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
ColorMaterial now uses LinearRgba authored by andristarr
[bevy_ui/layout] Handle ui heirchy change edge cases authored by StrikeForceZero
[bevy_ui/layout] Make fields private in UiSurface authored by StrikeForceZero
Handle winit's `WindowEvent::ModifiersChanged` authored by matthunz
Emissive is now LinearRgba on StandardMaterial authored by andristarr
document need to update Aabb in Mesh::(with_)insert_attribute authored by ua-kxie
Extrusion bounded authored by solis-lumine-vorago
EntityRef/Mut get_components authored by cart
add example showcasing how to force wasm to run in the background tab authored by cBournhonesque
Use oslog for ios authored by therealbnut
Add `RefreshState` resource and support same-state transitions authored by benfrankel
fix: upgrade to winit v0.30 authored by pietrosophya
UI: Image fills aspect_ratio of texture dimensions authored by bugsweeper
Fix normals during mesh scaling authored by solis-lumine-vorago
fix: added plugin registry authored by pietrosophya
Render Graph Rewrite authored by ecoskey
implement the full set of sort methods on QueryIter authored by Victoronz
Add more load_direct implementations authored by ricky26
Unrevert (vert?) "Add `on_unimplemented` Diagnostics to Most Public Traits" authored by alice-i-cecile
Initial Implementation of `temp://` Asset Source authored by bushrat011899
Fix a few typos authored by rparrett
bevy_reflect: `enum_utility` cleanup authored by MrGVSV
Implement subpixel morphological antialiasing, or SMAA. authored by pcwalton
Allow mix of hdr and non-hdr cameras to same render target authored by tychedelia
Implement opt-in sharp screen-space reflections for the deferred renderer, with improved raymarching code. authored by pcwalton
Issues Opened this week
The `Maximum call stack size exceeded` error will be thrown in a web worker. authored by jinleili
Enable wayland support in examples. authored by SetOfAllSets
updated mesh with custom pipeline is not rendered until next frame authored by ua-kxie
`WorldQuery::init_state` signature is too generous authored by alice-i-cecile
`KeyboardInput` events not being triggered by MacOS native overlays authored by matthunz
Expose API to precompile shaders for unspawned entities authored by jnhyatt
Depth of field should be enabled on webgpu authored by alice-i-cecile
User provided mesh binding / per-instance mesh data authored by tychedelia
Huge amount of data in vectors will not be released authored by mlp1802
Error during compiling alien cake: can't compare `std::ops::Range<{float}>` with `std::ops::Range<{float}>` authored by daresan
Run bevy systems in wasm even when the tab is not focused authored by cBournhonesque
Log messages from bevy dependencies displayed as `log` instead of their name authored by Satellile
The shadows' textures cannot be prevented from generating authored by rustui
`#[reflect(Trait)]` on a generic struct can't conditionally reflect depending on generic parameters authored by aristaeus
Segfault / status_access_violation when using Vulkan authored by GitGhillie
variable in reflect_remove method in ReflectExt trait has wrong naming and wrong docs description authored by rewin123
`Text2dBundle` is not frustum culled authored by rparrett
Implement `DetectChanges` for tuples and derived `SystemParam`s authored by wainwrightmark
Update information about ShaderDef's to indicate how to use non-boolean types in code authored by robojeb
Inconsistent resolution/segments naming authored by solis-lumine-vorago
Error logs are silently lost if `LogPlugin` is added late. authored by shanecelis
"smooth_damp" functions for primitives and math structs authored by vveisard
Add `temp:://` `AssetSource` for Temporary Assets authored by bushrat011899
slerp functions for directions (Vec2 and Vec3) authored by vveisard
Timer and Stopwatch should be explicit about the need to manually tick them authored by alice-i-cecile
Provide a way to base Timer on some Time object authored by jrmoserbaltimore