Interface IMaterialGenerator
Provides a mechanism to convert glTF materials into Unity Materials
Namespace: GLTFast.Materials
Assembly: solution.dll
Syntax
public interface IMaterialGenerator
Methods
GenerateMaterial(MaterialBase, IGltfReadable, bool)
Converts a glTF material into a Unity Material. gltfMaterial might reference textures, which can be queried from gltf.
Declaration
Material GenerateMaterial(MaterialBase gltfMaterial, IGltfReadable gltf, bool pointsSupport = false)
Parameters
Type | Name | Description |
---|---|---|
Material |
gltfMaterial | Source glTF material |
IGltf |
gltf | Interface to a loaded glTF's resources (e.g. textures) |
bool | pointsSupport | If true, material has to support meshes with points topology. |
Returns
Type | Description |
---|---|
Material | Generated Unity Material |
GetDefaultMaterial(bool)
Get fallback material that is assigned to nodes without a material.
Declaration
Material GetDefaultMaterial(bool pointsSupport = false)
Parameters
Type | Name | Description |
---|---|---|
bool | pointsSupport | If true, material has to support meshes with points topology. |
Returns
Type | Description |
---|---|
Material | fallback material |
SetLogger(ICodeLogger)
Has to be called prior to Generate
Declaration
void SetLogger(ICodeLogger logger)
Parameters
Type | Name | Description |
---|---|---|
ICode |
logger | Logger to be used. |