New Meshes, New Examples, and Compute Shaders
2024-04-15
This week in Bevy we've got some new meshes, new gizmos, and a couple of great new examples in the Bevy repo.
We've also got the first of the ludum dare participants showing off what they've been working on and some really deep dives in the educational section.
bevy_utils
has a tracking issue to either remove or reduce the crate. #12772 makes progress towards this goal. The overarching effort here is largely refactoring and moving code, so can be a great introduction to the codebase for newer contributors.
Triangle3d Meshing
Triangle3d
gets its meshing implementation. To me this is a particularly interesting meshing implementation because triangles are often thought of as the base primitive. Given the amount of comments, this PR and the associated code is a great place to look if you're interesting in how the meshing is constructed for bevy_math::primitives
.
In #12914 the Tetrahedron was also added to 3d gizmos.
.meta
files
Using asset .meta
files and Assets V2 are fairly new, so its nice to see a new example in #12882 for using .meta
files when loading assets like images which allows configuring settings like the image sampler options.
Compute Shader Readback
Reading data back from a compute shader is a very commonly requested tutorial and since the GPU is a completely separate device and some behavior can differ between platforms it can be hard to decipher how to handle it without an example. #12877 is a new example that uses crossbeam_channel
to communicate between the separate Main and Render Worlds. It includes a bunch of great comments detailing why code exists in different places and what the implications are.
Tracy
A number of PRs this cycle, including adjustments to MeshUniforms
, dividing the VisibleEntities
list, and Event
optimizations all include Tracy graphs. Setting up and using the Tracy profiler is documented in the profiling docs and can be an interesting tool to add to your Bevy debugging toolbelt.
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.
Better caves, bats, and a progress indicator
showcase
This showcase shows off the progress on this 2d wizard mining game. Cave improvements, bats, and more. The procedural generation was blocking and started to take too long so an additional progress indicator was added when generating worlds.
The shadows on the tiles that aren't visible are SkylightMask2D
s from the bevy-magic-light-2d crate. When a chunk is loaded, solid blocks are merged into rectangular selections for the chunk and an associated SkylightMask2d
is added for each selection.
CYBERSUMMONER for LudumDare
showcase
This game is an in-progress concept for the Ludum Dare game jam, which happens twice a year.
Asteroids
showcase
This asteroids game got a life system and a controls systems refactor on stream. It includes a custom asset loader for kenney spritesheets and depends on bevy_xpbd_2d for colliders and bevy_hanabi for particle effects.
bevy_flurx demo
showcase
This showcase is a demo puzzle game for an in-progress crate called bevy_flurx.
Source is available on GitHub
Upgrade shop blockout
showcase
This showcase is a blockout for the upgrade shop in a multiplayer wizard battler. There are play tests every other Saturday in the evenings (CET) which you can find in the project's discord thread in the Bevy Discord.
Top-down shooter
showcase
This top-down shooter recent gained extra zombie chunks that persist after they're defeated.
Scavenger
showcase
This game was built in the spirit of the last Bevy game jam. A devlog details the chosen theme as well as the work through the week.
Its a collection game with multiple levels where some collectibles increase points and other decrease points.
Crates used include
- sickle_ui alongside bevy_cobweb for reactivity
- bevy_ecs_tilemap for level building
- bevy_spritesheet_animation for easier spritesheet-backed animations
Voxels, tasks, and pathfinding
showcase
Voxel selection and task management make these little characters work on the area that was just selected.
The map is 256x256x64 which makes 3d astar pathfinding massive task. "Can this worker reach this job" is a hard question to answer.
There are separate navigation graphs constructed per entity type. Cats are small and can't scale ladders while colonists are two tiles tall and can use ladders.
Voronoi procedural mesh generation
showcase
The mesh is hand-crafted using voronoise with random y-offsets per-cell.
The discord thread includes some useful explanations of Quaternions as well as further discussion.
OK so you know how vec3's are just like an arrow pointing in a direction from 0, 0, 0 right? Just imagine that a quaternion is the same but with the fourth argument being a rotation around that vec3.
Crates
New releases to crates.io and substantial updates to existing projects
bevy_dev 0.3
crate_release
bevy_dev
contains a prototype material and new in 0.3: a debug fly camera. Included is the ability to switch between cameras.
bevy_spritesheet_animation first release
crate_release
bevy_spritesheet_animation
is a Bevy plugin for animating sprites that are backed by spritesheets.
Features
- A single Bevy component to add to your entities to play animations.
- Tunable parameters: duration, repetitions, direction, easing.
- Composable animations from multiple clips.
- Events to react to animations ending or reaching specific points.
- A convenient API to select frames in spritesheets.
Devlogs
vlog style updates from long-term projects
Zenith Devlog 1
devlog
The meat of the post is what the author learned about structuring systems and components from rewriting their level editor to be both more flexible and ergonomic.
Committing to Bevy
devlog
The author of this devlog is coming back to a project they were working on in a different game engine after falling out of love with their current process. Their new path forward is a commitment to using Bevy after a few weeks of experimentation to make sure it was the right move for them.
Educational
Tutorials, deep dives, and other information on developing Bevy applications, games, and plugins
Build/Sign/Debug a Bevy app for IPhone from Linux
educational
Building and signing applications for Apple devices is a huge pain, so its wonderful to see a very detailed post on not just how to build Bevy apps, but how to sign, create certs, and register devices.
Reactivity from the Bottom Up
educational
Reactivity is a popular topic these days, whether you're working in web development or other domains. This series of posts covers the backing information you'll need to understand what bevy_reactor is and why it exists. From primitives to signals to full on widgets there's a lot of information here.
more robust gpu image use authored by robtfm
Implement `From<&'w mut EntityMut>` for `EntityMut<'w>` authored by SkiFire13
Add previous_view_uniforms.inverse_view authored by JMS55
Moves intern and label modules into bevy_ecs authored by mnmaita
Bump crate-ci/typos from 1.19.0 to 1.20.4 authored by mnmaita
Document the lifetime requirement of `byte_offset` and `byte_add` authored by orzogc
Clean up some low level dependencies authored by james7132
Fix strings not interpolating in weely ci run authored by Brezak
Fix example game of life authored by mockersf
Fixed a bug where skybox ddsfile would crash from wgpu authored by Hexorg
Add example for using .meta files authored by MTFT-Games
Add gpu readback example authored by IceSentry
Fix potential out-of-bounds access in pbr_functions.wgsl authored by UkoeHB
Make some `ReflectComponent`/`ReflectBundle` methods work with `EntityMut` too authored by SkiFire13
Meshing for `Triangle3d` primitive authored by mweatherley
Fix beta CI authored by BD103
Use `impl Into<Color>` for `gizmos.primitive_3d(...)` authored by solis-lumine-vorago
Consolidate Render(Ui)Materials(2d) into RenderAssets authored by superdump
Created loading screen example authored by Remi-Godin
Small CI tool improvements authored by BD103
Generate `MeshUniform`s on the GPU via compute shader where available. authored by pcwalton
flipping texture coords methods has been added to the StandardMaterial authored by bugsweeper
Add tetrahedron gizmos authored by solis-lumine-vorago
Implement percentage-closer filtering (PCF) for point lights. authored by pcwalton
Enable `clippy::ref_as_ptr` authored by BD103
Divide the single `VisibleEntities` list into separate lists for 2D meshes, 3D meshes, lights, and UI elements, for performance. authored by pcwalton
Create custom action for installing Linux dependencies authored by BD103
fix find_current_keyframe panic authored by blukai
Don't examine every entity when extracting `SpriteSource`s. authored by pcwalton
Remove the system task span authored by james7132
Fix rendering of sprites, text, and meshlets after #12582. authored by pcwalton
Optimize Event Updates authored by james7132
Add archetypal to Access Debug impl authored by NiseVoid
Fix some nightly Clippy lints authored by BD103
tools: Refactor CI to use `argh` authored by MrGVSV
fix bevy_hierarchy crate optional feature `bevy_app` authored by ycysdf
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
Add an optional pass that generates a hierarchical Z-buffer, in preparation for GPU occlusion culling. authored by pcwalton
Improve par_iter and Parallel authored by re0312
Implement visibility ranges, also known as hierarchical levels of detail (HLODs). authored by pcwalton
Update docs of `set_if_neq` and `replace_if_neq` authored by RobWalt
Fix 2D BatchedInstanceBuffer clear authored by superdump
Curve trait for general interoperation authored by mweatherley
Accelerate Query::get authored by re0312
Add Disabled marker authored by NiseVoid
Remove redundent information and optimize dynamic allocations in `Table` authored by Adamkob12
Shader color conversion authored by solis-lumine-vorago
Name workflows and jobs in CI authored by BD103
Android GameActivity example authored by Cyannide
Fix extensionless image loading panic authored by VictorBulba
Improve `config_fast_builds.toml` and use it in CI authored by BD103
Load and convert RGB8 dds textures authored by Kanabenki
Expose `desired_maximum_frame_latency` through window creation authored by Kanabenki
Issues Opened this week
Improve documentation and example around enabling audio formats in Cargo.toml authored by brianearwood
Window hangs, refuses to close with a `NonSend`/`NonSendMut` system parameter in the `render_app` authored by simbleau
Ability to opt into change detection on `*ReadOnlyItem` in mutable `QueryData` derive authored by Themayu
iOS WASM out of memory error - asset loading authored by v-kat
A window behind app window takes focus when I click. authored by jinlee0
Expose maximum_frame_latency from wgpu to Bevy users authored by alice-i-cecile
Support DDS Format `R8G8B8` authored by doonv
Asset stuck loading when using init_resource without multi-threaded feature authored by NiklasEi
Configure `CheckVisibility` set to reduce boilerplate and error risk authored by alice-i-cecile
Expose `winit::monitor` as queryable component authored by tychedelia
Resolve `#[track_caller]` inconsistency in bevy's Query types. authored by Themayu