On this page |
Materials can be assigned to meshes generated by the plug-in in two different ways:
-
an existing Unreal Material Asset and specify it by attribute.
-
allow the plug-in to attempt to generate a new Unreal material based on the Houdini material found in the asset.
Houdini engine can also automatically create material instances from 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 an Unreal material that matches a material applied in Houdini.
There are two ways to assign the material:
-
Use the material network and assign it to the geometry from a material node.
-
Use a SHOP network and the
shop_materialpath
attribute.
The material reads for each primitive/face in the geometry produced and creates an Unreal material for each unique material. Constant values, colors, and textures are generated from the parameters/tagged parameters to the associated channel in the unreal material.
The following tables list the names of the parameters generated on a given material channel in Unreal. If the Houdini Material node on the mesh doesn’t have a parameter that match the following names, it uses any parameter available on the material node that has a matching compatibility tag.
Unreal Material Channel |
Principled Shader Parameter |
Parameter |
Compatibility Tag |
---|---|---|---|
Base Color |
|
|
|
Base Color (Texture) |
|
|
|
Metallic |
|
||
Metallic (Texture) |
|
||
Specular |
|
|
|
Specular (Texture) |
|
|
|
Roughness |
|
|
|
Roughness (Texture) |
|
|
|
Emissive Color |
|
|
|
Emissive Color (Texture) |
|
||
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 material bTangentSpaceNormal
uproperty is set to false and the normal map is in World space. If not, the normal map is in Tangent space.
Textures are required to cook to a file. Textures created by Houdini Engine are in the cook temp folder (HoudiniEngine/Temp), make sure to save them with your level.
Here is an example showing how to generate materials from your HDA:
The mesh generated in your HDA needs to have UVs.
-
Create a material sub network in your HDA (matnet).
-
Create a Principled Shader in the material subnet.
-
At the geo/sop level, add a material node to your generated geometry, pointing to the principled shader in the material subnetwork.
When instantiated in Unreal, the following principled shader parameters will be converted to an Unreal Material:
Unreal Material Channel |
Principled Shader Parameter |
Parameter |
Compatibility Tag |
---|---|---|---|
Base Color |
surface, basic, base color |
|
|
Base Color (Texture) |
textures, base color, texture |
|
|
Metallic |
surface, specular, reflection, metallic |
|
|
Metallic (Texture) |
textures, metallic, texture |
|
|
Specular |
surface, specular, reflection, reflectivity |
|
|
Specular (Texture) |
textures, reflectivity, texture |
|
|
Roughness |
surface, roughness, texture |
|
|
Roughness (Texture) |
textures, roughness, texture |
|
|
Emissive Color |
surface, emission, emission color |
|
|
Emissive Color (Texture) |
textures, emission, texture |
|
||
Opacity Mask |
textures, opacity, texture |
|
|
Normal (Texture) |
bumps and normals, base, texture path |
|
|
Normal Space |
bumps and normals, base, vector space |
|
|
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, a new Material instance of the source Unreal Material is created in the cook temp folder and assigned 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, this override will apply 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 aset ccording 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 can be controlled with single tuple attributes (Float or Integer). -
Vector
parameters are controlled with Float or Integer attributes with a tuple size of 4 or 3. Float attributes will be considered as a FLinearColor in Unreal, whereas Integer attributes will be interpreted as a FColor in Unreal. -
Enum
parameters (like Blend Mode) can be set either by using the string value of the enum or the integer value of int (starting from zero). -
Texture
parameters can be changed by 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 |