I started working on a procedural tree/vegetation generator yesterday. It generates a vast variety of trees/plants/shrubs dynamically and most results are quite convincing. Of course it still requires a lot of tweaking.
Here is a demo of my progress so far. Still no mesh and no lighting, but you can have fun with it I guess! Hit “n” to generate a new tree.
Thanks! At the moment, the trees are generated using billboards facing the camera, so I’m not sure it would look good on a landscape but I could try.
Nope! l-systems are very complex to manage in order to give good and realistic results. I use the space colonization algorithm, which is extremely simple and versatile.
Very cool, and close to some code I’m looking for. I’m a teacher who got roped in to doing a generative modeling project (visualizing cellular regeneration inside the eye of a Zebrafish). Its seems fun, but my students have 0 scripting skills and my own are kinda subpar…
Hope you can post (share or sell?) the code in the next few weeks.
Sure, if I’m able to properly convert the generated trees to a mesh, I’ll be selling the package with a full api and a tree editor. If I don’t have the time to do this, I could potentially release what I accomplished for free. Thanks for the comment!
Have you explored plant succession? Because this addition would create a dynamic placement of flora while using natural systems to bring about forests (the end game). It would be rad if a developer could be painting and the longer they painted an area the farther along in succession an area would be “painted” or by erasing it would turn back time on the succession of an area.
Ive been searching for a few weeks with no luck. How does one procedurally make a tree? i know thats a broad question, but even knowing how to access the tree.data variables would help so much. PLEASE
i have been scripting a few years and am quite familiar with unity
It is easy to read and understand. My advice: Take the time to draw on a whiteboard or with pen and paper! It helps a lot to understand the algorithm. Good luck!
By the way, I’m still working actively on the project. I just found a solution to polygonize the branches, so a new webplayer will be available soon.
Brilliant… very nice trees, you could keep it just as it is , just add different modes on top if this one it’s great. i would have sworn that it was 3d, because it looks like stacks of cylidners for the trunks.
I made some abit like this using cubes instead of cylinders… Then i want to map the mesh of the cubes on on top of each other and give them a vaguely incremental UV.
there is a briefer explanation in middle of this page:
Unity’s Tree is fine for pregenerated trees. I decided to write everything from scratch to be able to generate and modify trees in runtime in background threads.