On this page |
You can assign materials to meshes generated by the plug-in in two different ways:
-
through an existing Unreal material asset, which you specify by attribute.
-
through a new Unreal material, which the plug-in attempts to generate based on the Houdini material found on the asset.
Houdini Engine can also automatically create material instances from an existing Unreal material and procedurally change its parameters.
By Attribute ¶
The special Unreal to Houdini primitive attribute unreal_material
specifies an Unreal material asset to apply to a given primitive. This attribute has the path to the asset as its string value. You can get the path to the material asset by right-clicking and choosing Copy reference in the context menu.
If the sent mesh has more than one material, the value of the unreal_material
attribute will be prefixed by its material slot number in square brackets, for example:
[0]/Script/Engine.Material'/Game/StarterContent/Materials/M_Ground_Grass.M_Ground_Grass
You can also automatically create a Material Instance of a given Unreal material asset. See Material Instances for more information. You can change a physical material by using the unreal_physical_material
attribute.
Generate ¶
Optionally, the plug-in can attempt to generate Unreal materials based on the Houdini materials found on the asset.
The plug-in recognizes three ways in Houdini to assign a material:
-
Using a Material network and assigning it to the geometry using a Material node.
-
Using a SHOP network and the
shop_materialpath
attribute. -
Using a COP2 or Copernicus (COP) network and assigning it to the geometry using a COP Preview Material node.
The material reads each primitive/face in the produced geometry and creates an Unreal material for each unique Houdini material.
To generate materials from your HDA using a Principled Shader:
-
Ensure the mesh generated in your HDA has UVs.
-
Create a Material network in your HDA.
-
Create a Principled Shader inside the Material network.
-
At the GEO/SOP level, add a Material node to your generated geometry. Have the Material node’s Material parameter point to the Principled Shader in the Material network.
To generate materials from your HDA using a COP Preview Node:
-
Ensure the mesh generated in your HDA has UVs.
-
At the GEO/SOP level, add a COP Preview Node to your generated geometry.
Only some of the material channels will be translated to the Unreal material. See the below table for which ones.
On a SHOP node, Principled shader, or COP preview node, there are multiple ways to assign a material channel. For example, the base color channel has both a texture parameter and a constant color parameter. The plug-in chooses only one parameter to use for the material, and prefers textures over constant values.
The plug-in first searches for parameters by name. If a parameter of that name cannot be found, it searches for a parameter with a matching compatibility tag.
The names and tags are:
Unreal Material Channel |
Parameter |
Compatibility Tag |
COP Preview Node Parameter |
---|---|---|---|
Base Color |
|
|
|
Base Color (Texture) |
|
|
|
Metallic |
|
|
|
Metallic (Texture) |
|
|
|
Specular |
|
|
|
Specular (Texture) |
|
|
|
Roughness |
|
|
|
Roughness (Texture) |
|
|
|
Emissive Color |
|
|
|
Emissive Color (Texture) |
|
|
|
Emissive Intensity |
|
|
|
Opacity |
|
|
|
Opacity Mask (Texture) |
|
|
|
Normal (Texture) |
|
|
|
Normal Map Type (Tangent/World) |
|
Note
ogl_normalmap_type
determines the space of the normal map (Tangent vs World). If the parameter is set to World Space, then the plug-in sets the material’s bTangentSpaceNormal
UProperty to false and the normal map will be in World space. If not, the normal map will be in Tangent space.
Standalone Texture Import ¶
If you are using NodeSync, you can directly fetch a COP2 or Copernicus (COP) texture from Houdini, without having to attach it to a material. It will be translated into an Unreal texture. See the NodeSync page for more information on using NodeSync.
Material Instances ¶
You can automatically create a Material Instance from a given Unreal Material asset.
-
Assign the
unreal_material_instance
primitive attribute -
For the parameter’s string value, use the path to the material asset.
-
To obtain the path, right-click on the asset and choose Copy reference.
Upon cook, the plug-in creates a new Material instance of the source Unreal Material in the cook temp folder and assigns it to the generated geometry.
For landscapes, use unreal_material_instance
for the Landscape Material, and unreal_material_hole_instance
for the hole material.
Material Instance Parameters ¶
You can use material instance to control and modify material parameters in the attributes.
Change the material parameters in the generic unreal_material_parameter_
prefix. This works similarly to Generic UProperty Attributes
-
Add a detail or primitive attribute that begins with
unreal_material_parameter_
-
Append the name of your material parameter without spaces.
By default, the plug-in applies this override to any materials that have a parameter matching this name. If desired, you can specify the index of the material slot to apply this override to by prepending the material parameter name with INDEX_
where INDEX
is the material slot index. This only works if the unreal_material_instance
values have their corresponding material index prepended to the values. Otherwise, the index of each material is set according to whichever materials appear first in the list of unreal_material_instance
values.
This system works both for the standard material parameters that are always generated by Unreal when creating a material instance (BlendMode
, PhysMaterial
, TwoSided
) but also for the custom material parameters that expose scalar, vector or texture parameters defined in your material.
When it cooks, it overrides and sets its value to your specifications. This works for both the standard material parameters generated by Unreal and custom material parameters that expose scalar
, vector
, or texture
parameters.
For example:
-
To set the Diffuse Boost parameter to 2.0, add a
unreal_material_parameter_diffuseboost
detail attribute to your asset, and set its value to 2.0 (Float attribute) -
To change the Blend Mode parameter from the default Opaque value, to Additive, add a
unreal_material_parameter_blendmode
detail attribute to your asset, and set its value to either additive (String attribute) or 3. (Float or Integer attribute) -
To change a custom My Color Vector parameter that you created in your material, add a
unreal_material_parameter_mycolor
detail attribute, Float with a tuple size of 4, and set its value to the desired color value, ( 1.0, 0.0, 0.0, 1.0 ) for a bright red
This system currently supports 4 different types of material parameters:
-
Scalar
parameters, which you can control with single tuple attributes (Float or Integer). -
Vector
parameters, which you can control with Float or Integer attributes with a tuple size of 4 or 3. Unreal will interpret Float attributes as an FLinearColor, and Integer attributes as an FColor. -
Enum
parameters (like Blend Mode), which you can set either by using the string value of the enum or the integer value of int (starting from zero). -
Texture
parameters, which you can change with String attributes. To use an existing unreal texture asset, you can simply use the asset’s unreal path (obtained by right clicking on it and choosing Copy Reference).
To use a texture generated by the current Houdini Asset, you have two options:
-
For a single material, set the attributes to the material channel (basecolor (or diffuse), normal, specular, roughness, emissive, metallic, opacitymask).
-
For multiple materials, add the relative path to the SHOP node(or principled shader node) that generates the material before the desired channel. For example testgeometrysquab1/shopnet1/SquabSkin/diffuse. This path is relative to your asset node.
Attributes ¶
Houdini to Unreal ¶
This table lists special attributes to set in an HDA and the plugin recognizes when you translate the Houdini data to Unreal outputs. You can setup these attributes on your assets to control and override some properties and behaviours of the generated Unreal outputs. See Attributes and Groups for more information.
Materials ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
any |
string |
Unreal path of a Material asset to apply to an output. You can specify the material slot by prefixing the path with the slot number in square brackets. |
|
prim, detail |
string |
Unreal path of a PhysicalMaterial asset to be used as a Physcial Material on the output |
|
prim, detail |
string |
Unreal path of a PhysicalMaterial asset to be used for Simple Unreal Collisions |
|
prim |
int |
Mesh smoothing mask data |
Material Instances ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
prim, detail |
string |
Unreal path of a Material asset to create an instance of |
|
prim, detail |
string |
Unreal path of a Material asset to create an instance of, to be used for Landscape holes |
|
detail |
any |
Attribute prefix used to modify generated material instances' parameters |
Unreal to Houdini ¶
This table lists special attributes which are created by the plug-in when importing data from Unreal to Houdini. See Attributes and Groups for more information.
Materials ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
prim |
string |
Unreal path of a PhysicalMaterial asset taken from simple collisions |