This repo is a selection of contained examples using the Bevy game engine. It's split into three sub-folders:
- concepts
- examples
- libs
Concepts examples showing off ECS APIs and approachs like Component Hooks, Observers, Relationships, and mipmaps.
A variety of demos, often shader-related.
A shader example showing the usage of ShaderStorageBuffer
to pass variable amounts of configuration to a material to render candy cane stripes.
A custom material that uses a vertex shader to modulate the position of a series of cubes.
A dissolve effect that takes advantage of a custom prepass shader.
Outlines can be achieved in many ways, and the source for edge detection with something like a sobel filter can come from depth prepass, normal data, or anywhere else. This demo uses a custom render phase and artist-authored vertex colors to control where outlines show up. The custom phase renders the vertex data, using Bevy's mesh data pielines, to an image which is then used as the data source for the sobel filter in a postprocess effect.
Fresnel is an effect that is based on the viewing angle. This demo shows off the fresnel effect combined and broken down into its components.
There is an associated video talking through the effect using Bevy 0.8 which is fairly old, but the concepts are still relevant and the code in the repo here is up to date with Bevy's latest version.
Re-usable crates, some are public and some are used in the examples.
A utility package that provides a series of noise functions and other utilities for use in wgpu shaders. Noise functions provided include: perlin, simplex, voronoise, and a pristine grid.
A triplanar blockout material that uses worldspace coordinates to texture meshes using a grid where 1 box equals 1 world unit
A crate used in examples to display the depth, normal, and motion vector prepass information when examples use them.