Houdini Engine for Unreal
|
Materials can be assigned to meshes generated by the plug-in in two different ways:
Houdini engine can also automatically create Material Instances from existing Unreal Material and procedurally change parameters on these.
The special Unreal to Houdini primitive attribute unreal_material can be used to specify an Unreal material asset to apply to a given primitive.
This attribute should have the path to the asset as its string value. The path to the material asset can be obtained by right-clicking on it and choosing Copy reference in the context menu.
In a similar way, it is also possible to automatically create a Material Instance of a given Unreal material asset. Please see Material Instances for more information on the subject.
In version 2, you also have the ability to change a physical material by using the unreal_physical_material attribute.
Optionally, the plug-in can attempt to generate an Unreal material that matches a material applied in Houdini.
You can either use a material network, and assign the material to the geometry via a material node, or use the (legacy) shop approach, and assign the material using a SHOP network and the shop_materialpath attribute. The material will be read for each primitive/face in the geometry produced, and a corresponding Unreal material will be created for each unique material listed in this manner, by reading parameter values on the associated nodes.
Constant values, colors and textures are generated by copying the data read from a given set of parameters/tagged parameters to the associated channel in the unreal material.
The following tables list the names of the parameters that will be used to generate a given material channel in Unreal. If the Houdini Material node applied to the mesh does not have a parameter that corresponds to the following names, it will use any parameter available on the material node that has the corresponding "compatibility tag".
Unreal Material Channel | Parameter Name | Compatibility Tag |
---|---|---|
Base Color | basecolor | ogl_diff |
Base Color (Texture) | basecolor_texture | ogl_tex1 |
Metallic | metallic | - |
Metallic (Texture) | metallic_texture | - |
Specular | reflect | ogl_spec |
Specular (Texture) | reflect_texture | ogl_specmap |
Roughness | rough | ogl_rough |
Roughness (Texture) | rough_texture | ogl_roughmap |
Emissive Color | emitcolor | ogl_emit |
Emissive Color (Texture) | emitcolor_texture | - |
Opacity | opac | ogl_alpha |
Opacity Mask (Texture) | opaccolor_texture | ogl_opacitymap |
Normal (Texture) | normalTexture | ogl_normalmap |
Normal Map Type (Tangent/World) | - | ogl_normalmap_type |
An Unreal Material that connects Sampler nodes for those new texture assets into the Material results will be generated. This will trigger a recompilation of the associated shaders for the new Materials which may take some time.
Please note that textures are required to be cooked to a file. Textures created by Houdini Engine will be created in the cook temp folder (HoudiniEngine/Temp), do not forget to save them with your level.
Here is a simple example showing how to generate materials from your HDA:
When instantiated in Unreal, the following principled shader parameters will be converted to an Unreal Material:
Unreal Material Channel | Principled Shader Parameter | Parameter Name | Compatibility Tag |
---|---|---|---|
Base Color | Surface/Basic/Base Color | basecolor | ogl_diff |
Base Color (Texture) | Textures/Base Color/Texture | basecolor_texture | ogl_tex1 |
Metallic | Surface/Specular/Reflection/Metallic | metallic | - |
Metallic (Texture) | Textures/Metallic/Texture | metallic_texture | - |
Specular | Surface/Specular/Reflection/Reflectivity | reflect | - |
Specular (Texture) | Textures/Reflectivity/Texture | reflect_texture | - |
Roughness | Surface/Specular/Roughness | rough | ogl_rough |
Roughness (Texture) | Textures/Roughness/Texture | rough_texture | ogl_roughmap |
Emissive Color | Surface/Emission/Emission Color | emitcolor | ogl_emit |
Emissive Color (Texture) | Textures/Emission/Texture | emitcolor_texture | - |
Opacity Mask | Textures/Opacity/Texture | opaccolor_texture | ogl_opacitymap |
Normal (Texture) | Bumps&Normals/Base/Texture Path | baseNormal_texture | ogl_normalmap |
Normal Space | Bumps&Normals/Base/Vector Space | baseNormal_vectorSpace | ogl_normalmap_type |
It is possible to automatically create a Material Instance from a given Unreal Material asset.
To do so, simply assign the unreal_material_instance primitive attribute, and using the path to the material asset as the parameter's string value. That path can be obtained by right-clicking on the asset and choosing Copy reference in the context menu.
Upon cook, a new Material instance of the source Unreal Material will be created in the cook temp folder, and assigned to the generated geometry.
For Landscapes , unreal_material_instance can be used for the Landscape Material, and unreal_material_hole_instance can be used for the hole material.
When creating a material instance in this way, it is possible to control and modify material parameters via attributes. Material parameters can be changed via the generic unreal_material_parameter_ prefix. This works in a similar way than the Generic UProperty Attributes do.
Simply add a detail or primitive attribute starting with unreal_material_parameter_, then append the name of the material parameter you wish to modify to it (without spaces). Upon cook, Houdini Engine will try to find the corresponding material parameter on the generated instance, and will override and set its value to the one you specified in the attribute.
This system works both for the "standard" material parameters that are always generated by Unreal when creating a material instance ( BlendMode, PhysMaterial, TwoSided etc.) but also for the "custom" material parameters that expose scalar, vector or texture parameters defined in your material.
For example:
This system currently supports 4 different types of material parameters: