UE5/Houdini : Stylized Tree Tool


Result





Modeling

Trunk



First off, let's start by doing the most important part first, the trunk. For this tool I wanted the user to be able to make his own trunk with a curve in Unreal Engine and also have the possibility to do it with a more conventional way so I made the option possible.



Just a simple line with a AttributeVOP to make a gradient going from the first to the last point and adding a AttributeNoise to control the Position. We then make 2 more attribute to determine the pscale and the lift that we will use later on for the trunk mesh and the branches.

Branches




For the Branches, it's pretty much the same, juste make sure the output is slighty different from the trunk for more variation.



Next up, we begin with a Forloop to create the first branches. This is taken from the Labs Quick Basic Tree. This place copy of the trunk branch on the main trunk. We control the starting position along the main trunk with the Carve node.
Then we kill some points to places smaller branches later on.


We continue the process for the smaller branches with a simple CopyToPoints.


For the bending and twisting of the branches, we create a Foreach where we will randomize a bend attribute to a range controled by the user. This allows each branches to be unique to eachother and create a lot of variations.
We finish by merging everything, the trunk and the branches.



The end result should look like this. The amount of generation can be controled with the Repeat End iterations value. 
After we start with the leaves and trunk, add and OrientAlongCurve. All of this block of nodes can be found as I say withing the Labs Quick Basic Tree. I must say that I can't grasp all the logic behind it yet so feel free to correct me.

Trunk mesh




The trunk is nothing fancy, we keep it simple with a sweep and some cleanup. Make sure to add the Unreal Material node and add it to the asset properties.

Leaves




The leaves are placed along the branches points. Like the branches we use the Carve node to control the starting position and then we delete random points. The leaves need to have random rotation so we create those attributes. 



The leaves are copied with the CopyToPoint. I made the leaves with a simple quad and created Unitized UVs. Since most of it will be controled within the shader we don't really need to do more for this part.

Bushes




Along with the leaves, I wanted the user to have the option of using a blob mesh. This technique has been showed by Pontus Karlson on youtube in this tutorial : https://www.youtube.com/watch?v=iASMFba7GeI&ab_channel=PontusKarlsson

Here we use the cluster note to select cluster of points, then with a Foreach, we iterate those selections and use the Bound node along with a remesh to form a small blob surrounding those selection. This technique has been used by Simon Verstraete in his Houdini Unreal Starter Kit.



  We continue to process our "blob", the goal is to delete all the unwanted geometry, harden the normals and replace the tris and ngons with quads. We use the Instant Meshes node and the Quadrangulate to acheive this. We also need to harden the normal so that the billboard can function properly. After we can then create the UVs and unitize them to prepare the mesh for the shader in Unreal.



Material 



The material in Unreal is a standard billboard setup translated from Pontus Karlson video mentioned above.


The color is done proceduraly by using the VertexNormal to create a gradient from bottom to top. On top of that we fake the subsurface scattering using a fresnel pluged in the Emissive Color.


This is what my parameters look like. I keep it basic and go in order of priority along with 2 toggles for the Leaves type and Trunk type.

Conclusion 


This Tool was a challenge for me. Being the first "big" Tool I made in Houdini, this was a huge learning experience especially in making the HDA. The logic behind creating a simple tool for the user but a complex asset was an amazing task. I'm really happy with the result and the amount of variation this asset can produce.