Materials#
This section describes which of Unity’s material parameters are used when exporting USD.
Supported Materials by Render Pipeline#
Render Pipeline |
Shader |
---|---|
Built-In |
Standard |
URP |
Universal Render Pipeline/LitUniversal Render Pipeline/Complex Lit (When using Clear Coat) |
HDRP |
HDRP/Lit |
For each, the value is retrieved using the parameter name provided in the Shader. We recommend you use parameter names commonly used in Unity (_MainTex, _MetallicGlossMap, etc.) because then you may be able to get material parameters with other Shaders than what is listed.
Type of material to be exported to USD#
Material Type |
Description |
---|---|
None |
No material assignment |
MDL |
Assign OmniPBR or OmniGlass |
UsdPreviewSurface |
Assign UsdPreviewSurface |
Note
MaterialX is not supported yet.
Built-In: Standard#
Rendering Mode supports: * Opaque * Cutout * Transparent
Main Maps supports: * Albedo Color / Albedo Map * Metallic * Smoothness * Metallic/Smoothness Map * Normal Map * Occlusion Map * Emission Color / Emission Map * Texture transform: Tiling, Offset
Render Mode: Opaque#
Assign Opaque to an solid shape.
Render Mode: Cutout#
For shapes that involve trimming, such as tree leaves, assign Cutout.
Render Mode: Transparent#
Transparent uses the alpha channel of the Albedo Map and the alpha value of the Albedo color.
If the Albedo Map does not exist, the alpha value of the Albedo Color is output as the Opacity value of the USD.
If an Albedo Map exists and the alpha value of the Albedo Color is 1.0, the Alpha channel of the Albedo Map is used as the Opacity Map for USD (Opacity Mono Source=“mono_alpha” in OmniPBR).
If an Albedo Map exists and the alpha value of the Albedo Color is not 1.0, the Alpha channel of the Albedo Map is multiplied by the alpha value of the Albedo Color and used as the Opacity Map for USD (Opacity Mono Source=“mono_average” in OmniPBR).
Albedo#
If both Albedo color and Albedo Map are present, they will appear multiplied in the USD export. In USD, the Albedo map and Albedo Color each have their own parameters.
Metallic/Smoothness Map#
Channel |
Property |
---|---|
Red |
Metallic |
Green |
Occlusion |
Blue |
None |
Alpha |
Smoothness |
Smoothness = 1.0 - Roughness
The Metallic/Smoothness map is decomposed into a USD metallic map and a roughness map.
If the Metallic/Smoothness Map is not specified, specify the Metallic and Smoothness values as numbers from 0.0-1.0.
Normal Map#
When specifying a Normal Map, the strength of the Normal can also be specified.
When exporting USD, if the material type is MDL, both Normal Map and NormalMap strength will be output.
If the material type is usdPreviewSurface, the strength value is ignored because it does not have a Normal Map strength parameter.
Occlusion Map#
Occlusion Map is output when using UsdPreviewSurface as the material type for USD export.
Note
Occlusion Map output is not supported when OmniPBR is used.*
If an Occlusion value is specified (If not 1.0), the Occlusion Map and Occlusion value are baked into the texture and output.
Emission#
When the Emission checkbox is checked, Emission Color and Emission Map can be specified.
Texture transform: Tiling, Offset#
If a texture is specified, the same values for “Tiling” and “Offset” are used for all textures.
Note
Secondary Maps in Unity are not used in the USD export.*
URP: Universal Render Pipeline/Lit#
Base Color / Base Map
Metallic
Smoothness
Metallic/Smoothness Map
Normal Map
Occlusion Map
Emission Color / Emission Map
Texture transform : Tiling, Offset
Double Sided#
Note
when exporting USD, Render Face information is not yet output. Currently, as a USD, it is always displayed on single sided. In Omniverse, it is always displayed double sided.*
HDRP HDRP/Lit#
In the case of HDRP, the material is specified with parameters similar to those of the Built-In Standard. Since there are a few differences, we will explain only the differences.
In the HDRP Lit Shader, the following red parameters are the USD export targets.
Base Color / Base Map
Metallic
Smoothness
Mask Map (Metallic, Smoothness, Occlusion Map)
Normal Map
Emissive Color / Emissive Map
Texture transform: Tiling, Offset
In HDRP, specify Metallic, Smoothness, and Occlusion Map in Mask Map.
HDRP : Exporting OmniGlass#
HDRP allows for glass representation using IOR with HDRP/Lit Shader. When specifying some parameters, OmniGlass is used when the material is MDL in the USD export.
Use HDRP
SurfaceType = Transparent
BaseMap.alpha = 0.0
RefractionModel != None
In this case, OmniGlass is used in HDRP.
Parameters supported by HDRP’s Glass when exporting USD#
Smoothness
Index Of Refraction
Thickness
Transmittance Color (Color or Texture)
Clearcoat#
When using “Universal Render Pipeline/Complex Lit” in Shader for URP and “HDRP/Lit” in Shader for HDRP, a Clearcoat of the material can be used.
Clearcoat in USD#
Clearcoat in USD can be handled using UsdPreviewSurface. OmniPBR does not have Clearcoat parameters.
Two Clearcoat parameters exist for USD’s UsdPreviewSurface.
Parameter name |
Default |
Description |
---|---|---|
clearcoat |
0.0 |
Clearcoat value (0.0-1.0) |
clearcoatRoughness |
0.01 |
Clearcoat roughness (0.0-1.0) |
Both clearcoat and clearcoatRoughness can use float values or textures.
Clearcoat (URP)#
Parameter name |
Description |
---|---|
Mask |
Clearcoat value (0.0-1.0) |
Smoothness |
Clearcoat smoothness (0.0-1.0) |
These two parameters can be textures as well as numbers.
[R] Mask[G] Smoothness[B] None[A] None
Clearcoat (HDRP)#
Parameter name |
Description |
---|---|
Coat Mask |
Clearcoat value (0.0-1.0) |
In the Clearcoat Mask texture, Clearcoat Mask was set on the R, G, and B channels.
[R] Mask[G] Mask[B] Mask[A] None
In Unity’s HDRP, the ClearCoat Mask Map seemed to reference only the R channel.
Color Space#
Colors in Unity are often managed in sRGB.
In USD, colors are linear.
Color space is considered when specifying a single color or texture.
Color Space in Unity#
There are multiple places to specify color space in Unity.
Project Settings#
Select [Edit]-Project Settings from the menu.
In Player - Other Settings, under Rendering, you can select “Color Space.”
The default is “Linear”.
This unifies the rendering process with Linear.
This can be changed to “Gamma” for Built-In, but should be handled as “Linear.”
Texture#
In the Inspector, when you select a texture in the Project window, if sRGB (Color Texture) is checked, the texture will be treated in sRGB.
In Unity, textures representing “color,” such as Base Map (Diffuse Map) and Emissive Map, are generally handled in sRGB.
HDRIs such as hdr/exr are passed directly to the renderer as linear.
Normal maps, metallic and smoothness maps, etc., are not colors and are passed to the renderer as linear.
In Unity, textures are automatically converted to linear when passed to rendering.
Therefore, users and developers do not need to be aware of color space.
sRGB Color#
For the color of the material, it is to be specified in sRGB.
The color (sRGB) specified in the Base Map can be confirmed to be the same color (sRGB) in the rendering result.
These complex differences in color space are unified linearly at rendering time (linear workflow), and the flow is converted to sRGB, which is appropriate for the display when it is displayed.
Color Space in USD#
All colors in the USD format are linear and unified.
This conversion by color space is automatic in the Omniverse Unity Connector’s importer and exporter.
Linear Color#
For color, it is converted and passed so that it is in a linear color space.
The exporter in the Omniverse Unity Connector converts sRGB colors on Unity to linear and passes them to USD. Importers in the Omniverse Unity Connector convert linear colors in USD to sRGB and pass them to Unity.
Texture#
For each material texture, you can select auto/raw/sRGB as the color space.
The color space of this texture is specified as follows, as is the case on the Unity side.
Texture Type |
Color Space |
---|---|
Albedo Map |
sRGB (auto) |
Emissive Color Map |
sRGB (auto) |
Normal Map |
raw |
Roughness Map |
raw |
Metallic Map |
raw |
Ambient Occlusion Map |
raw |
Opacity Map |
sRGB (auto) |
Note
The Opacity Map of a material exported from the Omniverse Unity Connector uses the A of the RGBA texture specified in the Albedo Map.