docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IMaterialProvider

    Provides access to glTF materials.

    Inherited Members
    IMaterialsVariantsProvider.MaterialsVariantsCount
    IMaterialsVariantsProvider.GetMaterialsVariantName(int)
    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 meshResultOffset)
    Parameters
    Type Name Description
    int meshIndex

    glTF mesh index.

    int meshResultOffset

    Mesh result offset.

    Returns
    Type Description
    IMaterialsVariantsSlot[]

    Corresponding materials variants slots.

    See Also
    IMaterialsVariantsSlot
    MeshResult
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)