Crates.io | bevy_foliage_tool |
lib.rs | bevy_foliage_tool |
version | |
source | src |
created_at | 2024-08-29 01:17:08.201056 |
updated_at | 2024-12-12 23:40:19.314614 |
description | A configurable foliage painting system using perlin noise, grayscale maps, and chunked visibility |
homepage | |
repository | https://github.com/ethereumdegen/bevy_foliage_tool |
max_upload_size | |
id | 1355507 |
Cargo.toml error: | TOML parse error at line 22, column 1 | 22 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A very bevy-centric foliage painting plugin that takes advantage of entities, components and systems as much as possible to be as easy to understand and interact with as possible.
Create, edit, save, load, render your foliage all with one tool. Built with GPU mesh+material instancing in mind. Supports multiple layers of foliage, each with any mesh + material provided by you. The provided grass shader is toon-colored and waves in the wind.
An example of the tool being used in the spirit_editor:
cargo add bevy_foliage_tool
cargo run --example basic
In your main.rs :
app
.add_plugins(BevyFoliageToolPlugin {
foliage_config_path: "assets/foliage/foliage_config.ron".to_string()
} )
.add_plugins(BevyFoliageProtoPlugin )
;
Then make a system to load+register foliage assets: (for BevyFoliageProtoPlugin)
app .add_systems(Startup, register_foliage_assets) ;
...
fn register_foliage_assets(
asset_server: Res <AssetServer>,
mut assets_resource: ResMut<FoliageAssetsResource>,
mut next_state: ResMut<NextState<FoliageAssetsState>>,
) {
let green_material: StandardMaterial = Color::srgb(0.4, 0.7, 0.6) .into();
assets_resource.register_foliage_mesh("grass1", asset_server.load( "foliage/meshes/grass1.obj" ));
assets_resource.register_foliage_material("standard_green", asset_server.add( green_material ));
next_state.set( FoliageAssetsState::Loaded );
}
Then, define your foliage types : one for each layer
(
foliage_definitions: [
//layer index 0
(
name: "Grass",
mesh_name: Some("grass1"),
material_name: Some("standard_green")
),
]
)