The goal of this project was to create a Houdini asset for the promotion of the Houdini engine and to demonstrate a way to use the paint option in Unity. Because the release of the Unreal engine came closer during the development of the asset I shifted towards that. This while keeping it working under the Unity Engine.
In this article I will try to explain how i made the Ivy asset. The download link and the video are to be found here.
The build up
I started out with getting the vines. Which had to look natural and be fast enough to still be responsive when the user paints. I achieved that with the find-shortest-path(fsp) node and a randomized group of branch-endpoints within the painted area.
The painted area is basically a cutout of anything that does not have the value 1 in the v@Cd or a 0 in the i@cutout so anything other than white. After that I used connect adjacent pieces to connect the near painted objects. This is connected into a two-way to make the vines look natural with Remesh or a scatter with a find adjacent pieces.
Find shortest path
When the asset knows its region where to make the vines and the fins find-shortest-path node has done its work it is time to build the geo of the path with the wire node this one is connected to the f@pathcost attribute generated by the fsp node. The root should always have the thickest point and this is where I had a problem. because the root cost attribute is being overwritten each time it starts calculating the cost in the fsp it gave a unnatural look to the endpoint. The way that solved it was simple. just reverse the fsp. So the start would be the tip and the end would be the root. This way the highest value would win and the longer the vine the thicker the root (sweet!)! I also used this value for the coloring of the vine which is always darker at the root and lighter at the tip.
The leaves are instances (demonstrating the awesome instancing that is happening in the engine). coming out of the branch with a re-sample node. With the normal pointing at the direction the leaf should point at. The instance Sop is taking care of the instancing of in this case 6 different types of leafs. And re sizing them randomly.
Getting the asset to work in Unity and Unreal
One of the hardest was getting it working in the engine plugins of Unity and Unreal. It started out as a Unity plugin and it was still a R&D. The paint has to have a detailed point mesh to paint on and Unity only supports up to 65.000 poly so re-meshing the whole building was not an option when using bigger buildings and objects. So i first tried out a way to project a grid onto the building by making a C# script that uses the camera position and puts these values into the asset when pressing the project button then use that as a paintgrid.
This kinda works but what if the user wants to paint more than one and bigger ivy? That was the major bottleneck of this method. The re-meshing was not reliant however I could use the divide which has a bricker polygons option. This creates a mesh that has enough polygons but does not close to the 65.000 . So what happens is that where the user paints the asset cuts out that piece and re-meshes (or scatters) that to find a path for the vines.
For the whole painting of Unreal I had to go though a different route because the plugin does not (yet) support a easy way of painting. However unlike Unity, Unreal comes with a build in paint which also uses points. It is not directly connected to the Houdini Engine so the whole workflow and build-up had to change a bit. The paint happens in the middle of the network so I had so split the network up after the bricking. So I created a extra input to initially load the object/building into the asset and bricker it for the paint-able mesh. The next step would be to paint the object in Unreal and bake it out (option in the unreal plugin). The final step is to put that baked-mesh into the second input and let the asset do its thing. Tweek the parameters and the ivy is good to go.
The last big feature that was not incorporated into the asset is the bake vines. Which was a proof of concept using the new bake geo renderer. This was to use/create very lowpoly meshes out of the painted grid and project the vines geometry on it as textures with instanced leaves. It worked pretty well in Houdini but was not particularly user friendly on the unity and unreal side. however it would be cool to include that one day.
The project was way bigger than I initially anticipated and involved a lot of R&D and finding the boundaries of Houdini, The Houdini Engine, Unity and Unreal. But it was a great project to work on!
How to use the asset: