Environment - Walnut Tree 2

Finally wrapping back around to this project! This is the second part of my procedural tree tool, the first being focused on foliage generation. Now we will be getting into the actual structure of the tree.

Let’s get into the branches!

Procedural Branching

My plan going into this was to break down the tree into smaller parts. The trunk, the primary branches, and the secondary branches were going to have as much individual control as possible to give artist customization options. Like anything else, it’s best to work big to small on a procedural tool, because a big change like trunk height will effect the absolute transform of the next layers of branches.

Trees are a very common asset to make for games, so there are a few systems available to streamline this process. For one, there’s L-Systems, fully integrated and supported as a node set in Houdini. This is a notation that is used to described the natural growth order of plants in biology, and can be used to draw all sorts of fractal based nature structures. The problem I quickly ran into was the difficulty in exposing anything as a parameter. Adding a “+” to the logic string tells the graph to increment the rotation of the current segment, but this would be an action I would want the artist to be able to leverage at infinite interpolation. While L-Systems are convenient, they are much better suited to less customizable tools.

Another direction you could go is the built-in tree generator in Houdini. While this is nice, I felt it would rob me of the learning opportunity and practice of core Houdini fundamentals. Things like group and attribute manipulation, or proper parametrization of channels, is already taken care of. I really want this project to be about improving my ability to make any kind of procedural content, not just trees.

Here’s a few bare variations of the branches possible in the current form:

Bark Texture

Now for the real challenge. When I first set off to make a walnut tree, I knew that my approach to the bark would be something I had to workshop. Walnut trees have a very distinct deep grooving to their bark segments, so the convexity would have to be detailed in order for it to be convincing. I wanted to explore ways this could be accomplished in Houdini on its own, so I turned towards VDBs.

With a VDB setup, I was able to turn the shape of the tree into a volume that could run simulations along its surface. I found an interesting technique where you can attach points to a mesh with this method, and then run a vector field to control the directions those points move. In my case, the points would start at the base of the trunk, and then move up and out on the branches, sweeping a mesh along with them. I would be able to bake this down into a normal and height map, and do the base color from there.

The result is an artistic looking interpretation of tree bark, but I was going for something semi-realistic. There was also a list of issues with this method. How would I control the bark segment length? How would I manage the negative space between the bark? Not to mention, this immediately made iterating the tool take an unworkable amount of time to bake, which was a red flag for game optimization anyway.

Up until now the idea of the procedural workflow only registered for me in regards to Houdini, which is why I tried to solve this in that software. The only other texturing software I really had used was Substance Painter, but I couldn’t go that route because it wouldn’t be possible to author a texture set for rapidly generated meshes. However, Substance Painter has a procedural counterpart, Substance Designer, that I had been wanting to get into.

I took a lot of time investigating methodology and nodes that were most common for use in Designer graphs. In the past, I’ve done work with shaders for VFX that got me onboarded for things like normal ranges and blending. This seemed like a natural extension of that, and the parameterization works very closely to programs like Houdini or Unreal Engine. The end result is something I think is fairly close to my reference, and gives an appealing look to the structure of the tree.

Future Revisions

In my previous post about the Walnut tree asset, I had just finished up working on the pinnates, and showcasing some shader tricks in UE5. While it was a good start, there were a few issues that became immediately obvious with my approach. For one, while the pinnate itself was successful unique with export from Houdini, if you wanted variation from tree to tree, you would need one draw call for each unique pinnate map. There was also no way to have multiple pinnate variations on the same tree. Another consequence of the UV of every pinnate being identically placed was that the vertex and fragment displacement shader techniques made all of the pinnates move at the same rate, at the same time, which isn’t natural for a tree with leaves shooting out in all directions. All of this I expected to have similar issues with when I got to the branches themselves, so I needed to revise my strategy.

Ultimately, this is why I pivoted to working on a proof of concept game project in Unreal for the past month. I needed to become more familiar with Unreal and game optimization in general, so I took note of anything I stumbled across in my research that could be applicable to this project.

Improvements for next iteration:

  • Revising the shader displacement tricks as dicusssed above

  • UVs need to be done more thoughtfully in Houdini to avoid bark texture tearing in some areas

  • Materials aren’t behaving exactly as I want, namely shiny leaves and shallow bark height in engine

  • More iteration to branch placement, to make the tree be more full

The next post for this project will be a final wrap up for the walnut tree, as I intend to make this tool expand to the generation of other trees as well.

Stay tuned!

Previous
Previous

Motion Design - “Stay With Me” 1

Next
Next

Character - The Shrew