This week I decided to make a decent example of what is possible if you combine Houdini with Substance Designer. In post 14 I talk about how a real-time heightmap can be shown in Houdini, the example I used there was mainly simple bricks.
I feel it could be done better but didn’t had enough time to make a good material back then. When I had the system worked out I decided to make a tutorial about it. In the tutorial I start from scratch and show a basic simulation and how to export it.
This post will be about the debris material and how it was made in Houdini. I will not talk about the Substance Designer side, as this is a Houdini blog 😊
The result of one of the many possibilities with the Houdini simulation and Substance Designer combo.
A few days ago the GDC talk of Ben Wilson about debris and ruins in Wolfenstein got my attention. I remember watching that video when I was not using Houdini that much and now I feel that Houdini could be great for this. In the talk he goes over on how it was created from simulation to material. In his setup he gathered multiple debris models that was created in studio. Since I started from scratch I didn't had any debris to start with. This have me the idea to great a simple debris generator.
Debris piece generator
This is a small tool that has an input for a model and damages that model. Starting for creating this tool I can recommend this video around 5:48. I have used this system before in blog #7: PDG part1.
If you notice yourself using setups like these often it is a great idea to make a HDA, so you don't have to build it from scratch all the time.
Here is an image of the setup that you can find in the video.
By playing around with the settings of the mountain node, you can get nice results already. Notice also that in the video they stay quiet lowpoly. For the simulation is it a good idea to stay with a low polycount, if it is possible of course. With highpoly models the simulation will take longer to calculate.
UPDATE HERE: You can use a lowpoly model for the simulation and swap them after the simulation with the highpoly model. More info about that can be found here https://www.sidefx.com/docs/houdini/nodes/sop/xformpieces.html , this will show the transform piece sop and has an example file on the website.
You can also use the peak node after the mountain and this can be used to control the intensity of the damage.
After that you have that setup you can add Booleans to cut of big parts of the input model. The simplest way of doing this is create a sphere that has enough polygons and use a mountain on it to create a more interesting shape. Then Boolean the sphere with the model and subtract the sphere.
You could also build a small system that where you don’t have to manually drag the sphere around to Boolean it.
Here are some ideas that I tried out for automatically damage the model.
1: On each corner copy to points a sphere with mountain: works well on simple shapes.
2: Use bounding box and on each side of the bounding box place 1 point. On that point copy that sphere: Didn’t work out well, can give random results.
3: Adding an extra input in the custom HDA and the input will be points. These points will represent the spheres to damage.
As I didn't spend that much time on the tool, I stayed with these 3 options. With a switch node I can switch between the different types and see what works best.
I ended up with creating 13 different debris pieces. Time spend on this was about 1 hour and this includes making the custom HDA. This was a huge time saver and there was no sculpting needed.
Simulation setup
The simulation part was quiet simple. The main idea is that you let fall multiple of these debris piece on each other.
What you can do is creating 2 groups. One group is the big pieces with some mid sized piece and then the other group is small piece with a few mid sized piece. The small piece need to fall on top of the bigger piece. The reason for this is that otherwise the small piece will be at the bottom or fall at the bottom and would be that visible.
To quickly create these groups you can make a box and a scatter node. You will see that there will be random points created. By using copy to points the debris will be placed.
In the image you will see a few interesting things. First one is the attribute random, with this you can give each piece a random size and rotation. The name to use are pscale and rot. (see image below)
Then the second thing is the big loop to automatically place multiple piece. Watch this video to get the system https://www.youtube.com/watch?v=MwFARaaTLW4 . This was also used in my house generator.
When putting everything ready for the simulation it could look similar like this.
So like I said before smaller piece on top and bigger once at the bottom. You can add a color ID too, to use later on in Substance Designer. To add color, use the color node and make sure that you add the color in the points attribute.
To create the simulation itself I use the shelf tools. By looking to the rigid bodies and use the RBD objects you have the basic setup. You only need a ground the collision and the simulation will work.
Take a look at the video on 5:40 https://youtu.be/HtCxq8UZGD4 to get a good example on how it is used.
Make it tile
After the simulation you might be wondering on how it can be made tillable. With one node it can be made tillable. It is called mesh tiller. This is also part of the game dev tools so you will have to install those.
The tool is almost plug'n' play. The first input is the simulation and the other input will be a grid. The grid will be representing you texture space.
Using this mesh tiler is a time saver, so you don't have to manually try making it tillable.
As final step you can export everything and bake it in the software you prefer. Then the Substance part starts.
I hope you enjoyed the blog and found something interesting.
See you next week!