Class StandardMaterialExportBase
Converts URP/HDRP Lit and Built-In Standard shader based materials to glTF materials
Implements
Inherited Members
Namespace: GLTFast.Export
Assembly: glTFast.Export.dll
Syntax
public abstract class StandardMaterialExportBase : MaterialExportBase, IMaterialExport
Methods
ConvertMaterial(Material, out Material, IGltfWritable, ICodeLogger)
Converts a Unity material to a glTF material.
Declaration
public override bool ConvertMaterial(Material uMaterial, out Material material, IGltfWritable gltf, ICodeLogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| Material | uMaterial | Source material |
| Material | material | Resulting material |
| IGltfWritable | gltf | Associated IGltfWriter. Is used for adding images and textures. |
| ICodeLogger | logger | Logger used for reporting |
Returns
| Type | Description |
|---|---|
| bool | True if no errors occured, false otherwise |
Overrides
GetSmoothnessProperty(bool, bool)
Retrieves the smoothness property ID for the source material's smoothness value.
Declaration
protected abstract int GetSmoothnessProperty(bool sourceAlbedoAlpha, bool hasMetallicGlossinessMap)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | sourceAlbedoAlpha | True when the smoothness source is the Albedo map's alpha channel. |
| bool | hasMetallicGlossinessMap | True when a metallic-glossiness map is assigned to the source material. |
Returns
| Type | Description |
|---|---|
| int | The property ID for the smoothness value property in use. |
HasMetallicGlossMap(Material)
Detects whether a metallic-glossiness map is assigned to the source material.
Declaration
protected abstract bool HasMetallicGlossMap(Material uMaterial)
Parameters
| Type | Name | Description |
|---|---|---|
| Material | uMaterial | Unity source material. |
Returns
| Type | Description |
|---|---|
| bool | True if the material has a metallic-glossiness map assigned, false otherwise. |
IsPbrMetallicRoughness(Material)
Detects whether the source material should be exported as a PBR Metallic-Roughness material.
Declaration
protected abstract bool IsPbrMetallicRoughness(Material material)
Parameters
| Type | Name | Description |
|---|---|---|
| Material | material | Unity source material |
Returns
| Type | Description |
|---|---|
| bool | True when the exported glTF material should be PBR Metallic-Rougness based, false otherwise. |