docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GltfMaterialExporter

    Converts Unity Materials that use a glTFast shader to glTF materials

    Inheritance
    object
    MaterialExportBase
    GltfMaterialExporter
    GltfBuiltInShaderMaterialExporter
    GltfShaderGraphMaterialExporter
    Implements
    IMaterialExport
    Inherited Members
    MaterialExportBase.BaseColorProperty
    MaterialExportBase.MainTexProperty
    MaterialExportBase.ColorProperty
    MaterialExportBase.MetallicProperty
    MaterialExportBase.SmoothnessProperty
    MaterialExportBase.CutoffProperty
    MaterialExportBase.ConvertMaterial(Material, out Material, IGltfWritable, ICodeLogger)
    MaterialExportBase.SetAlphaModeAndCutoff(Material, Material)
    MaterialExportBase.IsDoubleSided(Material, int)
    MaterialExportBase.IsUnlit(Material)
    MaterialExportBase.ExportUnlit(Material, Material, int, IGltfWritable, ICodeLogger)
    MaterialExportBase.GetUnlitColor(Material, out Color)
    MaterialExportBase.ExportTextureInfo(Texture, IGltfWritable, ImageFormat)
    MaterialExportBase.ExportNormalTextureInfo(Texture, Material, IGltfWritable, int)
    MaterialExportBase.AddImageExport(IGltfWritable, ImageExportBase, out int)
    MaterialExportBase.ExportTextureTransform(TextureInfoBase, Material, int, IGltfWritable)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: GLTFast.Export
    Assembly: glTFast.Export.dll
    Syntax
    public abstract class GltfMaterialExporter : MaterialExportBase, IMaterialExport

    Methods

    ConvertMaterial(Material, out Material, IGltfWritable, ICodeLogger)

    Declaration
    public override bool ConvertMaterial(Material unityMaterial, out Schema.Material material, IGltfWritable gltf, ICodeLogger logger)
    Parameters
    Type Name Description
    Material unityMaterial
    Material material
    IGltfWritable gltf
    ICodeLogger logger
    Returns
    Type Description
    bool

    GetAlphaCutoff(Material)

    Returns that material's alpha cutoff threshold.

    Declaration
    protected abstract float GetAlphaCutoff(Material material)
    Parameters
    Type Name Description
    Material material

    Unity material.

    Returns
    Type Description
    float

    Alpha cutoff threshold value.

    See Also
    https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_material_alphacutoff

    GetAlphaMode(Material)

    Extracts the glTF alpha mode from a Unity material.

    Declaration
    protected abstract MaterialBase.AlphaMode GetAlphaMode(Material material)
    Parameters
    Type Name Description
    Material material

    Unity material.

    Returns
    Type Description
    AlphaMode

    glTF alpha mode.

    See Also
    https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_material_alphamode

    IsDoubleSided(Material)

    Indicates whether (back-face) culling should be disabled.

    Declaration
    protected abstract bool IsDoubleSided(Material material)
    Parameters
    Type Name Description
    Material material

    Unity material.

    Returns
    Type Description
    bool

    True if material does not do back-face culling. False otherwise.

    See Also
    https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_material_doublesided

    Implements

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