Skip to content

A procedural, obstacle avoiding, tree mesh generation tool for Unity.

License

Notifications You must be signed in to change notification settings

paternostrox/AdaptableTrees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌳 AdaptableTrees

Adaptable Trees is a mesh synthesis tool for Unity and a product of my graduation thesis. It is useful for creating beautiful customizable trees and bushes (or some other branching structure) considering obstacles in any preexisting 3D model. Until now, the tool does not support the creation of foliage. Sure would be nice if some hero made that contribution (maybe it's you? 👀).

Based on the Space Colonization algorithm, the method uses multiple voxelizations to identify obstacles in a 3D environment and comprehend different levels of detail. The method uses a flood fill algorithm to clusterize free voxels and reliably identify obstacles. The purpose of this work is to propose a good alternative to tree synthesis in large amounts and low cost, automating tree adaptability and reducing the need for meticulous artistic controls, without demanding from the user any artistic or coding background.

🔥 Basic setup:

  1. The user imports a 3D model and sets one or more voxelizations for the model. It is possible to set different voxelizations for different areas. vox-voxset

  2. The voxelizations are generated by flood fill, providing a discrete version of the model for the tree generation algorithm. show-occupied3

  3. The user picks the starting parameters for trees and clicks a location for one to be built on. tree-over-obstacle1

  4. The volume of the future tree crown gets checked for free voxels by flood fill in the voxelization containing it. The resulting crown "cloud" then gets populated with points which will serve as attractors for the mesh generation. tree-over-obstacle2

  5. The tree mesh is procedurally generated (and animated) based on the space colonization algorithm and a few extra constraints. If the user is not satisfied by the result, parameters can be altered and a new tree can be generated, also respecting the obstacles. tree-over-obstacle3

  6. Make sure to play with the parameters, tiny ajustments can generate very different structures! tree-adjust-before tree-adjust-after

  7. When you are done, you can also export the new forested environment to any other engine or modelling tool using Unity's FBX Exporter.

🌱 How to contribute

  1. Fork this repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and test them thoroughly.
  4. Submit a pull request with a clear description of your changes.

Packages

No packages published

Languages