docs.unity3d.com
    Show / Hide Table of Contents

    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. 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)

    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
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023