Interface IMaterialProvider
Provides access to glTF materials.
Inherited Members
Namespace: GLTFast
Assembly: glTFast.dll
Syntax
public interface IMaterialProvider : IMaterialsVariantsProvider
Methods
GetDefaultMaterialAsync()
Returns a fallback material to be used when no material was assigned (provided by the IMaterialGenerator)
Declaration
Task<Material> GetDefaultMaterialAsync()
Returns
| Type | Description |
|---|---|
| Task<Material> | Default material |
GetDefaultMaterialAsync(CancellationToken)
Returns a fallback material to be used when no material was assigned (provided by the IMaterialGenerator)
Declaration
Task<Material> GetDefaultMaterialAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Token to submit cancellation requests. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task<Material> | Default material |
GetMaterialAsync(int)
Get a Unity Material by its glTF material index
Declaration
Task<Material> GetMaterialAsync(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF material index |
Returns
| Type | Description |
|---|---|
| Task<Material> | Corresponding Unity Material |
GetMaterialAsync(int, CancellationToken)
Get a Unity Material by its glTF material index
Declaration
Task<Material> GetMaterialAsync(int index, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF material index |
| CancellationToken | cancellationToken | Token to submit cancellation requests. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task<Material> | Corresponding Unity Material |
GetMaterialsVariantsSlots(int, int)
Returns the material slots that correspond to the given MeshResult's sub-meshes.
Declaration
IMaterialsVariantsSlot[] GetMaterialsVariantsSlots(int meshIndex, int meshNumeration)
Parameters
| Type | Name | Description |
|---|---|---|
| int | meshIndex | glTF mesh index. |
| int | meshNumeration | Per glTF mesh MeshResult numeration. A glTF mesh is converted into one or more MeshResults which are numbered consecutively. |
Returns
| Type | Description |
|---|---|
| IMaterialsVariantsSlot[] | Corresponding materials variants slots. |