bevy_feronia 
Foliage/grass scattering tools and wind simulation shaders/materials that prioritize visual fidelity/artistic freedom, a declarative API and modularity.
[!CAUTION] This package is in early development and in an experimentation stage.
Getting started
cargo add bevy_feronia
The possible use-cases are demonstrated in the examples
Setup
The setup depends on the use-case, but a typical setup would look like something like this:
app.add_plugins;
The Scatter system needs to know when it can set up since it can depend on height mapping. You need to insert the setup state at some point.
[!NOTE]
In complex setups that load assets and bake a height map this can be after theStartup.
app.insert_state
or
ns_height_map.set;
ns_scatter.set;
Defining layers
A ScatterItem's LOD's are grouped by Name.
[!CAUTION] When defining multiple assets per layer without names, a different Asset will render when
LODsare changing, leading to visual bugs.
// Landscape
cmd.spawn;
Scattering
Now you can start scattering! ๐ฑ ๐ ๐ฟ ๐ ๐ณ ๐ฒ ๐ด ๐บ
cmd.trigger;
A ScatterLayer is always scattered in hierarchical order, but layers of different types can run in parallel.
[!TIP] If a hierarchical scatter is still required, observers need to be used to chain the scattering of types in order.
Credits/Inspirations/References
Feel free to copy the grass assets. All the other assets used in the examples are licensed assets.
[!IMPORTANT] If you intend to use them, make sure you comply with the license.
- Graswald for their amazing assets and
GScatter, which served as inspiration for the scatter tools. - Sucker Punch Productions for their Procedural Grass and Wind simulation in 'Ghost of Tsushima' and GDC Talks.
- bevy_procedural_grass by jadedbay
- warbler_grass by EmiOnGit
- GDC 2011 "Approximating Translucency"
- BlinnโPhong reflection model
- All the other assets
Roadmap
A bunch of issues are already open, but some of the larger milestones could be:
- Allow physics-based and other entities to impact the displacement/wind.
- Make use of compute shaders (Allow scattering on CPU and GPU, improve culling).