#bevy #gamedev #graphics #rendering #grass


A bevy plugin for creating 3d grass in your game

6 releases (3 breaking)

0.3.2 Apr 1, 2023
0.3.1 Mar 16, 2023
0.2.0 Mar 6, 2023
0.1.0 Feb 28, 2023
0.0.1 Feb 28, 2023

#177 in Game dev

Download history 99/week @ 2023-02-25 91/week @ 2023-03-04 136/week @ 2023-03-11 16/week @ 2023-03-18 15/week @ 2023-03-25 46/week @ 2023-04-01 118/week @ 2023-04-08 53/week @ 2023-04-15 110/week @ 2023-04-22 64/week @ 2023-04-29 131/week @ 2023-05-06

361 downloads per month



crates.io docs.io

A bevy plugin for ergonomic integration of grass in 3d games.

Currently, bevy version 0.10 is supported. Wasm builds are also supported!

Don't use this project for serious projects, it is still under heavy development. Currently, the project is not ready to be used besides side projects or for learning purposes

The preview image comes from my demo project where I use this crate for grass rending

Another cool project using this crate is the foxtrot template. Check it out!


Add warbler_grass as dependency to your project

warbler_grass = "0.3.1"

Add grass to your game:

use bevy::{prelude::*, render::primitives::Aabb};
use warbler_grass::prelude::*;
mod helper;

fn main() {
        // This plugin is needed to initialize everything for the grass render pipeline
fn setup_grass(mut commands: Commands, asset_server: Res<AssetServer>) {
    // Loading the height map from an image
    let height_map = asset_server.load("grass_height_map.png");
    // Constructing the height map struct
    let height_map = HeightMap { height_map };

    // Loading the density map from an image
    let density_map = asset_server.load("grass_density_map.png");
    // Constructing the density map
    let density_map = DensityMap {
        // The density corresponds to how dense a dense area is supposed to be.
        // Be careful with this parameter since the blade count grows fast. 
        density: 2.,
    commands.spawn(WarblersBundle {
        // The height of the blades
        height: WarblerHeight::Uniform(2.),
         // The aabb defines the area in which the chunk lives in
        aabb: Aabb::from_min_max(Vec3::ZERO, Vec3::new(100., 10., 100.)),

You can also use the editor to modify the maps in your game Take a look at the editor example on how this might work


You can find them in the example folder

Load grass

The basic example. If you just want to take a look how using this crate might look like, look no further

cargo run --example load_grass


A simple editor to modify and save the maps such as the density map of the grass Note that you also need the editor feature of this crate, which is not enabled by default

cargo run --example editor --features="editor"

Grass colors

You don't like the default grass color or you game has multiple seasons? Take a look how you can change the color of the grass

cargo run --example grass_colors

Grass mesh

You don't like the default mesh of the grass? Don't worry you can use swap the mesh easily. Note that you can press TAB to change the mesh in the demo

cargo run --example grass_mesh

Load explicit

You don't want to work with all the weird maps. All you want to do is define explicit positions for the grass blades to spawn in? You can definitly also do that

cargo run --example load_explicit

Many chunks

You'd like to see what this crate can do? Run this demo to see many chunks loaded at once. This example is also great to demonstrate the frustum culling of the meshes

# I'd run this demo in release mode first to see how your hardware can keep up
cargo run -r --example many_chunks

Stress test

This is not much of a example. It is used to limit test the crate. Of course you can also load it and see what happens.

# I'd run this demo in release mode first to see how your hardware can keep up
cargo run -r --example stress_test


If you read this part, you might consider helping this project grow. I consider this project very beginner friendly. It is relatively easy to grasp the workings since the use case is clear; to draw grass efficiently. Don't fear if you are a beginner in bevy or even rust!

Currently, the code can be optimized in many places and many features I'd like to have been partially or completely missing. You can always just create an issue and ask if something you want to do is needed.


~1M SLoC