docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IMaterialGenerator

    Provides a mechanism to convert glTF materials into Unity Materials

    Namespace: GLTFast.Materials
    Assembly: glTFast.dll
    Syntax
    public interface IMaterialGenerator

    Methods

    GenerateMaterial(Material, IGltfReadable, bool)

    Converts a glTF material into a Unity Material. gltfMaterial might reference textures, which can be queried from gltf

    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)

    bool pointsSupport

    If true, material has to support meshes with points topology Points

    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 Points

    Returns
    Type Description
    Material

    fallback material

    SetLogger(ICodeLogger)

    Is called prior to GenerateMaterial(Material, IGltfReadable, bool). 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
    In This Article
    Back to top
    Copyright © 2026 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)