These examples demonstrate how to use Bevy's features in a minimal, easy to understand way. Click an example below to run it in your browser (using WASM + WebGL) and view the source code. You can also view these examples (and others) in the Bevy repo.
If you would like to try WASM + WebGPU, you can explore our live WebGPU examples page.
Pixel Grid Snapping
Shows how to create graphics that snap to the pixel grid by rendering to a texture in 2D
Showcases slicing sprites into sections that can be scaled independently via the 9-patch technique
Shows how to create a 3D orthographic view (for isometric-look in games or CAD applications)
Shadow Caster and Receiver
Demonstrates how to prevent meshes from casting/receiving shadows in a 3d scene
Update glTF Scene
Update a scene from a glTF file, either by spawning the scene as a child of another entity, or by accessing the entities of the scene
Create and play an animation defined by code that operates on the `Transform` component
Shows how to create and register a custom audio source by implementing the `Decodable` type.
ECS (Entity Component System)#
A shader that shows how to reuse the core bevy PBR shading functionality in a custom material that obtains the base color from an array texture.
Post Processing - Custom Render Pass
A custom post processing effect, using a custom render pass that runs after the main pass
Many Animated Sprites
Displays many animated sprites in a grid arrangement with slight offsets to their animation timers. Used for performance testing.
Simple benchmark to test per-entity draw overhead. Run with the `sphere` argument to test frustum culling
Loads an animated fox model and spawns lots of them. Good for testing skinned mesh performance. Takes an unsigned integer argument for the number of foxes to spawn. Defaults to 1000
Simple benchmark to test rendering many point lights. Run with `WGPU_SETTINGS_PRIO=webgl2` to restrict to uniform buffers and max 256 lights
UI (User Interface)#
Demonstrates how the AlignItems and JustifyContent properties can be composed to layout nodes and position text
Font Atlas Debug
Illustrates how FontAtlases are populated (used to optimize text rendering internally)