UE4.27 | Houdini 19: PivotPainter
Preparation:
Assets preparation
Origin point calibration
Output settings
Post-production:
Import into Unreal Engine
Create shaders
Control with Blueprints.
Assets preparation
First, we will need a collection of components to create our assets. If we receive a pre-built asset, we may need to cut it into separate components ourselves. For example, in the image below, the asset includes separate components such as windows, ladders, and window frames (of course, we need to be mindful of the polygon count since we will be importing this into a game engine).
Origin point calibration
Here we have several functions to pay attention to. First is the assemble node, which helps us find the center point position of the small parts. The "add" function extracts the position of each center point and turns them into a point, so that we can export these points and tell Unreal Engine that these are our pivot points.
Houdini Origin Setup Image 1
Output settings
Houdini Output Setup Image 1
When we enter the output stage, we need to pay attention to two places in the Pivot Painter node, which are the Geometry Input and Pivot point Input. Both of these inputs must have the hierarchy attribute, so we need to find a way to write it in (as shown in the figure below). This way, the shader in Unreal can recognize which part the Pivot belongs to.
Houdini Output Setup Image 2
Follow the same image above (Houdini Output Setup Image 1). Next, we need to output the rotation axis, which is the N attribute. But this time, we only need to give the attribute to the Pivot Point Input on the right.
Houdini Output Setup Image 3
Afterwards, we can provide Unreal Engine with two textures, one for the position of the pivot and the other for the rotation axis. As for the alpha channel, we can use a random value.
Import into Unreal Engine
After pressing the export button, we will get two texture maps and a model.
We need to import them into Unreal Engine. For the texture part, we should use HDRCompressed as the compression setting and Nearest as the filter for the Texture field.
Create shaders
Now, I have actually created a function that you just need to follow in order to achieve the effect of building reconstruction.
The first thing to note is that the Texcoordinate should be set to 1. Position should be connected to position, rotation to rotation, and normal to normal. In the end, there will be two inputs, WOP and normal! Connect WOP to World position offset and Normal to Normal.
Control with Blueprints
We would like to use Blueprint to control the shader and achieve the effect shown in the image below. The most important node for this is here, which we can use to control the pivot point for reassembling.
Of course, there are other control options that can help us control the gradient changes after reassembly.
Final Resulat
Edit by Jimmy Chao, Yungjie Huang
Last Update: Novermer 30, 2021
Software: Unreal Engine 4.27, Houdini 19
OS: Windows 10
Reference::
https://www.youtube.com/watch?v=HKiLpX6OvAI