Interface IMaterialGenerator
Provides a mechanism to convert glTF materials into Unity Materials
Namespace: GLTFast.Materials
Syntax
public interface IMaterialGenerator
Methods
GenerateMaterial(Material, IGltfReadable, Boolean)
Converts a glTF material into a Unity Material.
Declaration
Material GenerateMaterial(Material gltfMaterial, IGltfReadable gltf, bool pointsSupport = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Material | gltfMaterial | Source glTF material |
| IGltfReadable | gltf | Interface to a loaded glTF's resources (e.g. textures) |
| Boolean | pointsSupport | If true, material has to support meshes with points topology Points |
Returns
| Type | Description |
|---|---|
| Material | Generated Unity Material |
GetDefaultMaterial(Boolean)
Get fallback material that is assigned to nodes without a material.
Declaration
Material GetDefaultMaterial(bool pointsSupport = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | pointsSupport | If true, material has to support meshes with points topology Points |
Returns
| Type | Description |
|---|---|
| Material | fallback material |
SetLogger(ICodeLogger)
Is called prior to GenerateMaterial(Material, IGltfReadable, Boolean). The logger should be used to inform users about incidents of arbitrary severity (error,warning or info) during material generation.
Declaration
void SetLogger(ICodeLogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| ICodeLogger | logger |