FrogCosmonaut/cosmo_tree_gen
关于
Procedural tree generator addon for Godot 4
游戏与模拟器可以做什么
- Live generation and auto-updated in the editor.
- Configurable tree parameters using custom Resources.
- Multiple trunks per node, roots and broken branches by chance.
- Branch level length and leaf card size by curve.
实测星标增长
- 24小时
- +2
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
Cosmo Tree Gen
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.
Also available on: Godot Asset Store - Godot Asset Library
Mainly inspired by Dan Shiffman and EZTree.
100% Human made. No AI was or ever will be used in this project.
Showcase
| Save and load presets fast | Randomize by seed |
|---|---|
![]() |
![]() |
| Live generation | Curve editor for fine changes |
![]() |
![]() |
Features
- 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.
- Billboard impostor baked on export as the last LOD, static or octahedral: 2 triangles and 1 draw call for distant trees. See Impostor types
- 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, impostor and collisions, optionally linking the materials in the .import file.
- 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.
Requirements
Godot 4.6+ required. Developed in 4.6.2.stable.
Installation
Copy the addons/cosmo_tree_gen/ folder into your project, enable it.
You can see more examples and presets in the demo folder.
Usage
Add a CosmoTreeGen node and pick a preset from the toolbar.
See Getting Started for the full walkthrough.
Documentation
Roadmap
By priority.
- 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.
- Hierarchical wind for trunk, branches and leaves.
- 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. - 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.
- Make it compatible with older Godot versions.
- Preset gallery with preview.
- Branchlet texture generator.
- Graph editor.
Credits
Code, assets and references
Code
- Octahedral impostor shader: godot-imposter by Zhang Juntao,
a Godot 4 port of Godot-Octahedral-Impostors by wojtekpil and iFire (MIT).
Modified to add backlight and mipmaps. License inaddons/cosmo_tree_gen/shaders/impostor_octahedral.gdshader.
Assets
- Leaves: 60 CC0 vegetation textures
- Bark: ambientCG Bark014
- Icosphere foliage: Made manually with GIMP.
- Logo: Procreate + Inkscape, background rendered in Blender, font Neuropol.
References
- Icosphere: lslabs, schneide.blog
- Trees/branching: EZ-Tree, Coding Train, Algorithmic Botany
- Impostors: ShaderBits: Octahedral Impostors, IMP
LICENSE
Released under the MIT License.
探索相关项目
加载中…



