Procedural foliage for Godot, quickly, straight into yor project. Foliage is fully interactive and supports anything that a normal Godot scene supports, including collisions. Multimesh optimization comes out of the box. LODs are manual, added by the artist.
This plugin is meant to be used with Terrain3D and will not work without it.
Written in the beautiful and concise GDScript language. Even though it's interpreted, the code uses optimal data structures and is multithreaded out of the box, making it blazing fast in practice.
Feel free to use in your projects (distributed under MIT), but if you do, please consider pinging me and telling me about your use case.
- Open Godot4, create a new project.
- Head to AssetLib and download Terrain3D (or alternatively download from here)
- Copy the
assets/foliage_3d
folder into your project - Head to Project Settings and enable
Terrain3D
andFoliage3D
. - Restart the engine.
You'll be using a few custom resources:
FoliageMesh
--- holds a reference to mesh, together with a list of material overrides for each of the surface of the mesh.FoliageLOD
--- describes a foliage asset rendered at some LOD. Contains a list of meshes and other optional parameters.FoliageAsset
--- describes an asset that can be instanced by Foliage3D.- Levels of Detail --- here you can set different
FoliageLOD
objects. Also you need to map the quad tree LODs to foliage LODs usingqlod_to_flod
. - Interactive Scene --- low-lod (by default, only LOD-0) instances will be asynchronously replaced by an instanced scene. This is how you can achieve collisions and further interactivity.
- Transform --- set rotation / scaling randomization here.
- Levels of Detail --- here you can set different
FoliageSpecies
--- essentially a FoliageAsset, but with some more meta information. Includes abundance (probability of finding this species at a random location) and grid randomization settings.FoliageLayer
--- this describes a collection of species placed on a grid with configurable spacing. E.g. this can be "forest trees". A very important setting here isterrain_texture_names
: foliage will only be generated on matching textures.
Just create a top-level Foliage3D
node, and in the settings give it:
- A reference to your
Terrain3D
. - A reference to your observer
Node3D
: this is the origin object around which the LODs will expand. - A list of foliage layers.
You don't.
This plugin assumes foliage is procedurally generated on the painted terrain. You can control the foliage by painting different textures on the terrain.