6 examples of using Houdini for Unreal Engine
KEVURU GAMES
We create game art and develop games. Areas of specialization: 2D/3D art, concept art, animation, gamification, etc.
Hello! My name is Viacheslav Titenko, I'm a TechArt and VFX lead at Kevuru Games. In our team, we often use tools that help us realize projects of maximum complexity. For example, the combination of UE (Unreal Engine) with Houdini, a software package for working with three-dimensional graphics, can significantly simplify game development.
In this article, together with Houdini Artist Pavel Filevsky, we will analyze several practical cases of using UE with Houdini. The examples we'll give are appropriate for Unity, as well as in combination with other procedural applications like Blender.
The material will be useful for tech and VFX specialists, level artists and designers, and game developers. Our case studies will help you better understand the techniques used in modern games, improve your pipeline to solve complex problems and choose the path of further development.
Retopology - creating a simplified model of an object
One of the easiest uses of UE and Houdini is retopology, which is the conversion of 3D models with a large number of polygons into something that can be used in animation. If necessary, you can also make LODs (Levels Of Detail) - several variants of the same object with different degrees of detail, which are switched depending on the distance of the object to the virtual camera.
Let's look at an example. For one of our projects, our specialists made custom tools for ivy and other plantings. If you take each element of ivy separately, it has a reasonable number of polygons. However, in general, there are too many of them, which would be an unreasonably large task for the modeling department. In such cases, we always try to simplify the work for our colleagues and optimize the 3D model.
UE itself doesn't do retopology the way we would like. Therefore, we needed to build tools that would quickly reduce the number of polygons with minimal manipulation - and only those objects that would be clearly defined by the visuals and polygonage.
Let's start by analyzing the area of each individual object - we record the minimum and maximum. Then we recalculate the difference in the range from 0 to 1 and remove the smallest objects.
The next step is to reduce the number of polygons on the stems that have the same name and material. Usually, when materials are different, they are easily separated by the polygon attribute, but in our case, it doesn't work. However, we do have a difference in the location of the vertices on the UV scan. And this is enough to calculate their coordinates and separate them by U position.
Small stems can be selected separately using the scale parameter.
We apply Polyreduce to each part with its own settings, put it all together, and clean up unnecessary attributes, and the job is done. In this way, the polygon count of this ivy was reduced from 560 thousand to 110 thousand polygons.
UE wouldn't have been able to do this optimization with the internal tool, because it would have cut the polygons evenly on the leaves, and that would have been wrong. However, for LOD, its auto tool worked well, and from a distance, the number of triangles was only 14 thousand. Otherwise, LOD can also be done in Houdini.
Destruction of complex objects
The next case study is a model with fortress textures that we worked with while developing a strategy game. We needed to create a historical event of the destruction of a structure.
For complex destruction simulations, UE makes innovations in physics, but everything doesn't work as easily as we would like. At the same time, for realistic animation, you can use Houdini to record the behavior of parts of the object being destroyed. This tool often comes in handy when we need to simulate the destruction of complex objects.
The Houdini setup is quite complicated. We will analyze the main stages, and more detailed examples can be found in official sources.
First, you need to identify the components and set them to the correct breakage. For example, you want the wood to break according to the structure of a log, and the stone parts to have straighter fractures. It should also be taken into account that some parts have side edges that need to be UV scanned and assigned new materials.
Then we set the physics and logic. The next step is to simulate the destruction. In our example, the top of the building collapses first. The top itself first falls in one piece and only then shatters. After that, the stone part folds in half, taking the wooden sidewalls with it.
The last step is to export everything to UE. To do this, you need to write the animation information about each piece (there are almost 3 thousand of them) to an FBX file. It looks like a bone structure, where each object is one bone. To do this, we use a special Labs node called RBDtoFBX.
领英推荐
The disadvantage of exporting in this format is heavy animation. After all, if you multiply 3 thousand bones by 500 frames for the entire animation, it takes up a lot of memory. That's why we used another method for exporting - VAT (Vertex Animation Texture). We'll talk about it in the next case study.
Vertex animation using textures
The next tool is VAT, which allows you to record vertex animations in textures. This is a relatively new method, but our experience shows that you shouldn't be afraid to use innovative technologies, because they are the future. So, with VAT, you can transfer complex animations not by writing information to a file, as Alembic does, for example, but by using raster textures, where RGB information replaces XYZ coordinates. In this way, we manage to save resources significantly, and sometimes dramatically.
Let's see how it works. In our case study, we had a task to implement an animated jellyfish that we bought from stock.
The problem was that for the smooth movements of a large number of tentacles, the animation was made with various modifiers in applications such as 3D Max or Maya. So we took a heavy Alembic file from the stock.
Using SideFX Labs tools for exporting animation to VAT, we create a texture. At first glance, it looks like a mess of colored pixels. But it contains all the information you need to animate the positions of the model's points and polygons. It also contains data for the engine, such as UV coordinates or custom attributes created in Houdini.
For importing into UE5, we also used a set of tools from SideFX Labs. It can be conveniently added to project files directly from the node responsible for texture export.
As a result, we get smooth, complex animation without the use of bones and with minimal performance costs.
Creating visual effects simulations
The next thing worth mentioning is creating various simulations for VFX, such as fire, explosions, smoke, etc., as well as rendering them and assembling them into Flipbook textures. With the help of Houdini, our team does this as quickly as possible without compromising the quality of visual effects.
Let's look at the principle of creating fire. To do this, you can create your own setup or use ready-made presets from the PyroFX tab. Select any object, for example, a previously created sphere with surface noise, and click on Bonfire. Next, we adapt our model to the required combustion parameters.
To loop the beginning of the flame burning with the end, we shift timeshift2 by 40 frames, and timeshift1 by 40 + 64.
Then we set the camera and rendering parameters to a 64-frame square. Set up the material and render the sequence.
Now all that's required is to collect all the renders in Flipbook. Go to the Composition context, load the sequence, and use the Mosaic node with 64 frames. Don't forget to move the time slider by one frame.
Changing preset parameters using the Houdini Engine
Another useful tool from SideFX developers is the Houdini Engine plugin. It allows you to access Houdini's procedural tools inside other 3D editors and game engines. Thanks to this, our artists save a lot of time on their work.
The way it works is quite simple. In Houdini, you use nodes to create an asset with any necessary parameters. Then it is imported into the game engine using the Houdini Engine. And you can change the set parameters directly in the engine.
On the developer's website, you can learn more about this technology and see examples of its use: www.sidefx.com/products/houdini-engine.
Working with large landscapes
When it comes to diverse landscapes, we use Houdini's Terrain/Hieghfields toolkit. It provides all the advantages of a procedural approach to creating large realistic spaces in a 3D package.
The developer can transfer all the necessary information to the game engine using a DEM and texture map with masks for further customization within the engine. Thanks to this, our team effectively works with the landscapes of large open worlds.
Here's an example with a detailed explanation of how the desert was created and how this technology works: https://www.sidefx.com/tutorials/procedural-desert/
Conclusion
Houdini's technology is developing rapidly, and there are more and more examples of how the tool can improve the lives of game developers. So, as a technical artist, I invite game developers to dive into the world of a procedural approach to modeling, animation, and programming - this way you can work as productively as possible.