This is inspired by - obviously - the great A. Opara talk about biological tree growth, and that push me to implement my own take on it, surely not as elegant nor efficient tho!
I started with the idea of an avoidance model, based on an modified version of the ambient occlusion vex code (sop context) from Tokeru wiki, so many kudos to Matt Estela and the awesome tokeru wiki, which taught me the base of vex for many months (love the gifs!).
The pseudocode for the growth is:
only on active points
check next possible positions within a cone
accumulate occlusion for each possible points
choose the one with the least occlusion and set new direction
blend with previous direction
check chance to split in branches and spawn new active points with correct orient
grow toward new direction based on apical ratio, occlusion, iterations, stepsize, etc…
Features for now:
- geo avoidance (random or even search points)
- branch angle, tropism & gravity influence
- codominance chance (need work)
- break chance of branches based on length (need rework)
- Root system
- leaves instancing, no sim for now but its fast
- generated geo + uv with sweep (tokeru wiki was a great help here once again)
- wire sim + procedural constraints
- geo capture with for-each branches id + wirecapture
- wind affecting wire sim + fake leaves movement (for speed)
It's not as art-directable as some more traditional tree modeling method, but i had a lot of fun developing this one and adding features.
Todo:
- simplify parameters (way too many to be really practical)
- rework of the random branch cut, impact the growth time calculation too much because of the foreach within foreach
- better handling of codominant branches geo creation ? uv looks bad
- surface attraction for ivy-style effect
- code and network clean-up cause it's a mess and some attributes are not used anymore
- better leaf generator
- …
When i first started, the plant only divided when enough amount of energy was accumulated on active points, then splitting would drain some energy. It was somehow quite uncontrolable but produced some crazy result. I even implemented a graph monitoring energy for that, I would like to fix it at some point.
Thanks for your attention and, in advance, sorry for any engrish in the text ! (not a native english speaker)
more render tests here [www.artstation.com]