Vello, Steamdecks, and procedural generation
2024-05-06
This week in Bevy we've got some project changes relating to contributing, PR review, and the formalization of working groups, new color grading and state-management features, as well as some exciting experiments and demos.
Particularly interesting on the experimental side of things is a new crate and some experimentation with Bevy/Vello integration.
Additionally I'd like to call out the VisibilityRanges, Filmic color grading, and GPU Frustum Culling PRs as being particularly well-commented with straightforward PR descriptions. They serve as great entry points into reading about their respective topics in the Bevy context.
Filmic color grading
Bevy's existing tonemapping featureset expands to a complete set of filmic color grading tools, matching those of engines like Unity, Unreal, and Godot. This includes white point adjustment, hue rotation and color correction. There's also a brand new example (color_grading
) that acts as a playground for exploring the color grading featureset.
Xilem and Vello
While not directly Bevy related, There's a talk on Xilem happening at RustNL this week. This is interesting because the rendering backend for Xilem, Vello, is already being used in tandem with Bevy for rendering SVG and other UI. This includes the bevy_vello crate as well as more experimental integrations like the board game showcase (discord link) mentioned later in this issue.
Project Contribution Changes
Alice has started their first day and generously decided to put up a public board indicating their personal priorities. This is by no means an "official Bevy roadmap" but rather it is just Alice sharing what they're working on. Some of the first changes made were
- refactoring issue and PR labels
- more guidance on closing PRs as well as requesting reviews
- a formalization of "working groups"
The formalization of working groups is especially nice as this means there is a documented process for broad consensus building and for joining in on or starting new work.
GPU Frustum Culling
The view frustum is the area of the world that might appear on-screen. "Frustum culling" is the process of removing objects that won't appear in that area and thus would waste resources to render. Frustum culling can now optionally be done on the GPU. To enable it, add the GpuCulling
component to a camera.
Visibility Ranges (Hierarchical Level of Detail)
This commit introduces a new component, VisibilityRange, which allows developers to specify camera distances in which meshes are to be shown and hidden. Hiding meshes happens early in the rendering pipeline, so this feature can be used for level of detail optimization. Additionally, this feature is properly evaluated per-view, so different views can show different levels of detail.
Meshlets
Meshlets got LOD-compatible 2-pass occlusion culling and data upload performance optimizations this week.
The example added last week to demo meshlets requires downloading an asset that was deemed too large to include in the git repo. That asset is now documented in the meshlet
example metadata.
ComputedStates (and SubStates)
With #11426 the capabilities of State
related infrastructure expands from just States
to include ComputedStates
and SubStates
.
ComputedStates
are derived states while SubStates
are states that only exist inside other states. The functionality seems very flexible and I'm excited to see what usage patterns people land on after they're more widely used.
There are three examples now, including the base state and the new computed_state and sub_state examples.
Alice's Weekly 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.
Jarl quick-items menu
showcase
The ui here is all vanilla bevy_ui for Jarl, a fantasy colony builder.
Svincraft on Steamdeck!
showcase
Svincraft is a tech demo using Bevy that now also runs on Steamdecks! You can check out the code on the steamdeck
branch or check out the video on YouTube
TrenchBroom inspired 2D map editor
showcase
HillVacuum is an editor for building 2d Doom-style maps. I found it easiest to see what it does in this YouTube video but the README is also informative.
VR Chat vibes
showcase
This VR chat demo pulls inspiration from this hidden alley scene and the Discord thread contains some fun progress from the first image to the one that you see here.
reactive JSON-based scripting language
showcase
A JSON-based scripting language for Bevy, now with events!
{
"id": "sword_of_invincibility",
"durability": 0.1,
"max_durability": 1,
"damage": ["-", 1, ["/", ["@", "durability"], ["@", "max_durability"]]],
"on_equip": {
"add": "invincible"
}
}
Steam Audio rewrite in Rust
showcase
Steam Audio is a spatial audio solution and this showcase is the beginning of a rewrite in Rust. As such it is an audio-based demo and is best listened to using the original upload found in the Discord thread
Markov Junior
showcase
Markov Junior is a probabilistic programming language where programs are combinations of rewrite rules and inference is performed via constraint propagation. In another phrasing "Markov Junior is a DSL for procedural generation".
Consider the following, which is enough of a setup to generate the maze you see here.
let find = Pattern::basic_2d(vec![1, 0, 0]);
let replace = Pattern::basic_2d(vec![1, 2, 1]);
Cart's Chess-like Vello experiment
showcase
This showcase demos a Bevy rendering abstraction using Vello, as well as a nascent feature for required components.
The Require Components feature is an experiment itself in allowing Bevy Components to declare other Components that are required to exist on an Entity. Such required components would be inserted with their Default values in this experiment, if they didn't already exist.
#[derive(Component, Default)]
#[require(Transform, Visibility)]
pub struct VelloRendered;
On the topic of Vello, this demo uses a custom VelloRender
trait that can be implemented for Components, which will then re-render with Vello whenever the Component changes.
The code is available in a gist but if you plan on using Vello as a consumer you may prefer to use bevy_vello instead.
There's some great discussion on the topic of Bevy + Vello in the Discord thread.
Dekirisu's Animal Crossing inspired game updates
showcase
Updates this week for this Animal Crossing-inspired aesthetic game include
Crates
New releases to crates.io and substantial updates to existing projects
Bevy EntiTiles 0.9.0
crate_release
bevy_entitiles is a 2d tilemap crate inspired by bevy_ecs_tilemap and bevy_ecs_ldtk. The major feature in 0.8 is support for multiple tilesets on one tilemap.
bevy_async_task
crate_release
Bevy Async Task provides Bevy system parameters to run asyncronous tasks in the background with timeout support and future output in the same system. It also provides syntactic sugar to reduce boiler plate when blocking on futures within synchronous contexts. Supports wasm and native. mobile is untested.
bevy_vello
crate_release
bevy_vello is a rendering integration for rendering vector graphics in the Bevy game engine. Currently it renders standard vello Scenes, as well as SVG and Lottie files.
Devlogs
vlog style updates from long-term projects
The Making of Fishing for a Princess
devlog
Saya's first devlog
devlog
Saya is a game featuring voxel graphics where you play a samurai summoned to rid the worlds of darkness. As you defeat enemies, you gradually accumulate evil essence with the help of your saya, which you can then utilize to enhance your abilities.
Alice's Rust Gamedev survey
devlog
Alice ran a short (5 days) survey of the Rust gamedev space and the results are in! Take them with a grain of salt but the information can still be interesting.
To Build a Home
devlog
This is the first look at an upcoming life simulation game called To Build a Home. It's inspired by games like the Sims and Dwarf Fortress, it aims to create a complex simulation of human life, focused on the small scale of everyday life. The game behavior is defined in text files and sprites that can be easily changed by players, making modding very easy.
Restore dragons to their seat of power authored by BD103
Implement GPU frustum culling. authored by pcwalton
Meshlet LOD-compatible two-pass occlusion culling authored by JMS55
Add error when extract resource build fails authored by aevyrie
Improve `config_fast_builds.toml` authored by BD103
Add Reflect derive to Events and contained types authored by alice-i-cecile
Add paragraph on requesting reviews authored by alice-i-cecile
Add note on partial reviews authored by alice-i-cecile
new format for ci config file authored by mockersf
Use BindGroupLayoutEntryBuilder in texture_binding_array example authored by mgi388
Example setup for tooling authored by mockersf
fix: rewrite winit loop authored by pietrosophya
Computed State & Sub States authored by lee-orr
Implement Reflect for Result<T, E> as enum authored by TheNeikos
add schedule docs authored by cBournhonesque
Reorganize issue labels authored by alice-i-cecile
Add guidance on closing PRs authored by alice-i-cecile
Fix CI error on new color grading example authored by alice-i-cecile
Implement filmic color grading. authored by pcwalton
Add Testing section to the PR template authored by NiseVoid
Update glam version requirement from 0.25 to 0.27 authored by mnmaita
Add `README.md` to all crates authored by BD103
Add a process for working groups authored by alice-i-cecile
Simplify winit runner exit code reporting authored by Brezak
Implement visibility ranges, also known as hierarchical levels of detail (HLODs). authored by pcwalton
fix `bevy_gltf` crate build authored by ycysdf
Add BufferVec, an higher-performance alternative to StorageBuffer, and make GpuArrayBuffer use it. authored by kristoff3r
examples: Add `Dynamic Types` reflection example authored by MrGVSV
Give alt text to Bevy logo authored by BD103
Implement Auto Exposure plugin authored by Kurble
Use folder for example showcase reports and add show logs flag authored by IceSentry
Move compile fail tests authored by BD103
Separate unrelated code to submodules in compute/sub-state examples authored by MiniaczQ
Make one-shot example more noob friendly authored by rmsthebest
Schedule resource mutation authored by lee-orr
Fix `custom_loop` example to include plugin finalization authored by philpax
Meshlet remove per-cluster data upload authored by JMS55
Re-export IntoDynamicImageError as public authored by stinkytoe
move wgsl color operations from bevy_pbr to bevy_render authored by arcashka
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
Gltf loader reads texCoord field of texture authored by bugsweeper
bevy_reflect: Function reflection authored by MrGVSV
Allow specifying intermediate textures for cameras. authored by Brezak
Improve tracing layer customization authored by cBournhonesque
Skip redundant mesh_position_local_to_world call in vertex prepass shader authored by AmionSky
Wgpu 0.20 authored by Elabajaba
Make `AssetMetaCheck` a field on the asset plugin authored by Brezak
Add a `doc-generate` command to the `ci` tool authored by BD103
Use safe window handles and `wgpu::Instance::create_surface` authored by ids1024
Increase SSAO occupancy authored by JMS55
improve asset loading unhappy path authored by robtfm
Add json output flags to our CI tool authored by Brezak
Enable skipping/running SystemSets during Stepping authored by cBournhonesque
Add UV channel selection to StandardMaterial authored by geckoxx
Pack multiple meshes into vertex and index buffers. authored by pcwalton
allow more configuration for showcase from the CLI authored by mockersf
Separate state crate authored by lee-orr
Determine msrv for every bevy_* crate. authored by Brezak
Fix the WebGL 2 backend by giving the `visibility_ranges` array a fixed length. authored by pcwalton
Don't update app if we're already exiting authored by Brezak
More idiomatic texture atlas builder authored by s-puig
Added a Grey trait, and implementations on baked-in colors. Fixes #13206 authored by Earthmark
Ensure clean exit authored by tychedelia
Issues Opened this week
Add `World::entity_scope` to split the borrow on the `World` by extracting a single entity authored by alice-i-cecile
Add `EntityMut::components` and`EntityRef`` and `EntityWorldMut` equivalent authored by alice-i-cecile
Ability to detect if touch input is available authored by inodentry
VSCode, Rust-analyzer recompiling issue in 13.2 authored by SnappierSoap318
Incorrect handling of EntityRef/Mut Queries + Resources resulting in false conflicts authored by iiYese
Asset-Driven Nine Patch authored by inodentry
Emissive materials not displayed properly when imported from gltf files authored by Overblob
Support WebGL2 and WebGPU in the same WASM file authored by BD103
UI: image with Absolute position don't render correctly authored by mockersf
Cleanup: derive trait implementations on cubic spline structs authored by mweatherley
Cleanup: `Reflect` on `bevy_math`'s curve structs authored by mweatherley
Add `rust-version` field to `bevy_mikktspace` authored by BD103
Crash in write_indirect_parameters_buffer on start of application authored by arcashka
Add a `Gray` color trait authored by alice-i-cecile
Create alias to `ci` tool authored by BD103
Sending a `GamepadButtonChangedEvent` but `Axis<GamepadButton>` is not changed authored by Shute052
Allow Bevy windows to be spawned as a child of an existing window authored by vveisard
Asset Server incorrectly parsing files with # in their name authored by thebluefish
`ColorMaterial::emissive` field should use `LinearRgba` authored by alice-i-cecile
Please re-export IntoDynamicImageError as public authored by stinkytoe
Implement all non-trivial color traits on `Color` type authored by alice-i-cecile
Tracking Issue: Curves Working Group Tasks authored by mweatherley
macos: app hangs after pressing window close button authored by rparrett
Bevy can't render default shapes if `bevy_render` has `shader_format_glsl` enabled. authored by jimvdl
Window despawns during Update schedule authored by gcx11
bevy_reflect::List::iter wraps silently on release authored by TheNeikos
Allow external plugins to intervene more deeply in the rendering process of Sprite (Mesh2d). authored by 443eb9
duplicate_vertices silently consumes indices authored by tbillington
TrackedRenderPass::wgpu_pass may compromize invariants authored by fintelia
`[f32; 4]` conversions missing from `bevy_color` authored by tychedelia
Fluent builder methods for bevy_reflect ParsedPaths. authored by viridia