Procedural tree generator for Godot 4. Create and tweak trees live in the editor, save them as presets, and export them to glb/glTF with LODs and collisions.
Mainly inspired by Dan Shiffman and EZTree.
100% Human made. No AI was or ever will be used in this project.
- Live generation and auto-updated in the editor.
- Configurable tree parameters using custom Resources.
- Trunk and branches.
- Multiple trunks per node, roots and broken branches by chance.
- Branch level length and leaf card size by curve.
- Optional flat shading for PSX/PS2 aesthetic.
- Foliage.
- Icospheres, with configurable subdivisions level.
- Card leaves, configurable amount and double sided, with canopy normals and inner AO.
- Leaves shader with wind sway and limited mipmaps, so alpha scissor doesn't make distant leaves disappear.
- Automatic collision generation.
- Three shape types: one convex shape per branch, one convex shape per branch segment, or a single trimesh.
- Covers branches up to a configurable level (0 = trunk only).
- Collision preview in the editor.
- Foliage collision: hull (covers all the foliage), spheres on each leaf/branch end.
- Automatic LOD generation.
- LOD0, LOD1 and LOD2 MeshInstance3Ds can be generated with customizable ratios and distances.
- The trunk is simplified and the rest of the tris budget goes to the leaves.
- Leaf cards are not simplified, fewer and bigger cards are kept instead.
- Presets.
- 4 premade presets included (Ash, Bush, Low Poly Bush and Low Poly Tree)
- 7 more premade presets can be found in the
demofolder. - Can be saved as
CosmoTreePresetresources.
- Export as glb/glTF with LODs and collisions, optionally linking the materials in the
.importfile. - Exposed API for script generation, see Batch Generation.
- Editor toolbar: load/save presets, randomize seed, export, and it shows draw calls and tris counter per tree.
Godot 4.6+ required. Developed in 4.6.2.stable.
Copy the addons/cosmo_tree_gen/ folder into your project, enable it.
You can see more examples and presets in the demo folder.
- Add a
CosmoTreeGennode. - Pick a preset from the toolbar menu, or tweak
trunk_paramsandfoliage_paramsand addCosmoBranchLevels tobranch_levels. - Set bark and foliage materials, or use the ones in
addons/cosmo_tree_gen/materials. Note: icosphere foliage needs a material with UV1 Triplanar. - Optionally, to generate collisions, set
collision_typeandcollision_level, and optionallycollision_max_heightto cut it at a given height. Preview it togglingpreview_collision. - Optionally, toggle
generate_lodfor LODs. - Tris budgets for LOD and distances can be configured in the project settings, see Settings.
- Can be used as is for quick prototyping or exported as glb/glTF from the toolbar.
Work in progress.

Curve editor for fine changes.
By priority.
- Billboard impostor PNG generation for the last LOD.
- Add more low-poly foliage variations. (Pine, Boxes)
- Add a tree age slider. From sapling to old tree.
- Add min-max ranges to presets. It should define a species, from young to old.
- Shadow proxy. Low poly mesh for foliage with
SHADOWS_ONLY. - Bake tree in-place and make the node game-ready. So it can be used without extracting to
.glb. - Hierarchical wind for trunk, branches and leaves.
- Add stumps, fallen trunk and felled trees. From the same seed.
- Add flowers, fruits and mushrooms/fungus on the trunk/branches.
- Generate one texture atlas per bark+foliage to reduce 1 draw call.
- Preset gallery with preview.
- Branchlet texture generator.
- Graph editor.
- Make it compatible with older Godot versions.
Icosphere:
- https://blog.lslabs.dev/posts/generating_icosphere_with_code
- https://schneide.blog/2016/07/15/generating-an-icosphere-in-c/
Trees/branching:
- EZ-Tree author: https://tympanus.net/codrops/2025/01/27/fractals-to-forests-creating-realistic-3d-trees-with-three-js/
- Coding Train / Dan Shiffman: https://www.youtube.com/watch?v=MwLyeEWnMCY
- https://algorithmicbotany.org/
- https://en.wikipedia.org/wiki/L-system
- Leaves: https://opengameart.org/content/60-cc0-vegetation-textures
- Bark: https://ambientcg.com/view?id=Bark014
- Icosphere foliage: Made manually with GIMP.
- Logo: Procreate + Inkscape
- Logo background render: Blender
- Logo font: Neuropol - https://www.dafont.com/es/neuropol.font



