Part 1 Here
I gave up on the Foliage system I was building for Project Pegasus.
It's not my first rodeo with building foliage systems in Houdini. This is my 4th go at the problem.
My first attempt was around 4 years ago. I didn't want to use Speedtree, and naively thought I could do better. The result was a set of tools in Houdini that I think of as "Lystem Power Armour". Essentially I built a parameter interface around the existing Lsystem node in Houdini so that artists wouldn't need to write systems directly. It worked ok, and taught me a lot about Houdini, procedural modelling, and of course trees.
In my second try round, I focused a lot on how to process scanned data and fuse that with procedural workflows.
My third attempt, which began a year ago, is ongoing. I got hired by Applied Intuition to build a set of in-house tools to replace Speedtree in their pipeline. It is not using Lsystems this time, instead it is a pretty complex simulation of shoot growth and branching that allows for species to be defined by general rules. This project was the culmination of a lot of studying of scientific papers and books on how plants actually grow. It is fair to say that I was heavily inspired by the work and general philosophy of Anastasia Opara. Mimic the process, not the result..
However, each time, I remain unsatisfied. The tool does not produce botanically plausible plants, or it does not produce them quickly enough, or there are too few parameters, or too many. The user-experience is painful, or certain species would be hard to model. Each time, I have gone back to the drawing board, and with Project Pegasus it was no different.



It is right to question whether building custom foliage tooling was even the right move for Pegasus, given that the project has a short duration, small team, and the fact that other foliage tools already exist. In fact Houdini even has its own Labs tree tools as of about a year ago.
Another of Project Pegasus' artists, Tilman Mielsh, uses Simple Tree Tools, a commercial plugin for Houdini, which seems to a very robust and feature rich analogue to the Speedtree way of working. We spoke about using these tools, and about using the labs tools, but ultimately decided to go with a novel approach, that we would be able to share the development of, and share with the community at the end.
But, as I said at the beginning, I have given up. In general I hate giving up. I'm more of a stubborn - keep trying different hammers kind of guy, but this time I got totally stuck. I had a frank phone call with Ian Smith, the lead artist, and essentially we made the decision that I should probably move on, maybe to revisit the foliage tooling later. And if it wasn't for Feike Postmes that is probably what would have happened... But more on that later.
First lets talk a little about the system!

The Foliage system that I designed for Pegasus is intended to bridge the gap between simulation (The Grove) and direct modelling (Speedtree), while stealing some of the best bits of like Lsystems, Space Colonisation and architectural analysis of tree structure.
The core of the idea is that artists work with atomic* tree parts, or prototypes: Stems, Branches and Forks. These are not actual organs, but rather structural modules that when assembled in different configurations can describe the branching structures of any plant. You can think of each prototype as being a simple Lsystem string. These prototypes are represented in the node graph by a seperate node each, and the artist "arranges" their tree by organising these prototypes into a "node tree". clusters of connected prototypes can be thought of as more complex lsystem strings.


In this way, if we stick with the lsystem analogy, artists have a gui that allows them to physically move around and wire nodes which results in the automatic construction of complex lsystems (or branching systems).
You might be thinking that this sounds an awful lot like the traditional direct modelling paradigm, and you'd be right, it's just stems on stems, but that's because I left out an important detail. The protoypes are not actually geometry, they are, like lsystems, just bundles of logic, or instructions, which all get evaluated (or solved), in a later step.

There is solver componenet to the systems, which evaluates the tree of nodes (prototypes), above it, and, over a set number of steps, will then grow a tree that is determined by the arrangement of those prototypes. The prototypes contain information about how to twist, how many branches they have, how many steps they should recurse for and also how to respond to external factors like light, gravity and collisions.

The prototypes and solver are the core of the system, but there are also switch, select, prune and control nodes, each with additional purposes:

Switch: choose between two prototypes based off a condition (e.g. age exceeds certain value)
Select: choose between n prototypes based off of probability
Prune: cause a prototype to "die" after a certain condition is met (e.g. vigor below certain value)
Control: use ramps to direct multiple prototypes changing parameters with respect to certain attributes (e.g. branch angle change with respect to height)
In a way, it is better to think of this toolkit as an animation state machine for plant growth, rather than simulation or modelling. The prototypes, like lsystems, provide a granular grammar (but visual) to explicitly control a very complex system. Since there is a visual tree of nodes that describes the plant, it should be much more intuitive and open to experimentation.
And that's it, basically!
Unfortunately, after some very promising progress for 3 weeks, I got well and truly stuck, and despite several days of hair pulling and jaw-clenching, had to admit defeat. Fortunately, Pegasus is a team project, and doubly fortunately, I happen to have some inspiring team members. One of whom ( the aforementioned Feike), saw the potential in the system, and wasn't quite ready to let it die. So for now, he's taken over development.
Feike completely rebuilt the logic and code of the system without altering the core design, and progress so far seems to be going very well. If this trend continues, then pretty soon we should some very exciting new tools and foliage workflows to share in the near future. Which, I should emphasize, will very much have a focus on game-development friendly workflows as well as refinements to cumbersome tasks like producing LODS and optimized wind.
Of course, it wouldn't be fair to make you read all of this without showing the actual system in action, so here are some very early, pre-pre-alpha shots of the system in action, producing a simple tree structure. Eventually, plants produced using the system will look a lot more organic and realistic, since they will benefit from artist-defined control ramps to dictate things like the gravitropic response profile, branch angle and competition for light and space, but you'll just have to take my word for that for now :D


For my part, I've switched my focus back to terrain, which was after all my original remit. I'll be sharing more on that in my next blog!
* Stole Tilmans terminology for little bitty bits of plants2