use bevy::{prelude::*, render::primitives::Aabb}; use warbler_grass::prelude::*; mod helper; fn main() { App::new() .add_plugins(( DefaultPlugins, // This plugin is needed to initialize everything for the grass render pipeline WarblersPlugin, // Just a helper plugin for spawning a camera // As in all examples, you can use the wasd keys for movement and qe for rotation helper::SimpleCamera, )) .add_systems(Startup, setup_grass) .add_systems(Update, change_colors) .run(); } fn setup_grass(mut commands: Commands, asset_server: Res) { let y_map_image = asset_server.load("grass_y_map.png"); let y_map = YMap { y_map: y_map_image }; let density_map = asset_server.load("grass_density_map.png"); let density_map = DensityMap { density_map, density: 2., }; commands.spawn((WarblersBundle { density_map, y_map, aabb: Aabb::from_min_max(Vec3::ZERO, Vec3::new(100., 10., 100.)), // you can define the color for each grass chunk grass_color: GrassColor { main_color: Color::DARK_GREEN, bottom_color: Color::DARK_GREEN * 0.5, }, ..default() },)); } // we can also change the color over at other times // this can be useful if your game has seasons fn change_colors(mut grass_colors: Query<&mut GrassColor>, time: Res