docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BuiltInMaterialGenerator

    Converts glTF materials to Unity materials for the Built-in Render Pipeline

    Inheritance
    object
    MaterialGenerator
    BuiltInMaterialGenerator
    Implements
    IMaterialGenerator
    Inherited Members
    MaterialGenerator.DefaultMaterialName
    MaterialGenerator.RenderTypeTag
    MaterialGenerator.TransparentCutoutRenderType
    MaterialGenerator.OpaqueRenderType
    MaterialGenerator.FadeRenderType
    MaterialGenerator.TransparentRenderType
    MaterialGenerator.AlphaTestOnKeyword
    MaterialGenerator.TextureTransformKeyword
    MaterialGenerator.UVChannelSelectKeyword
    MaterialGenerator.GetDefaultMaterialGenerator()
    MaterialGenerator.Logger
    MaterialGenerator.GetDefaultMaterial(bool)
    MaterialGenerator.FindShader(string)
    MaterialGenerator.FindShader(string, ICodeLogger)
    MaterialGenerator.SetLogger(ICodeLogger)
    MaterialGenerator.TrySetTexture(TextureInfo, Material, IGltfReadable, int, int, int, int)
    MaterialGenerator.TransmissionWorkaroundShaderMode(Transmission, ref Color)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Cloud.Gltfast.Materials
    Assembly: Unity.Cloud.Gltfast.dll
    Syntax
    [MovedFrom(true, "GLTFast.Materials", "glTFast", null)]
    public class BuiltInMaterialGenerator : MaterialGenerator, IMaterialGenerator

    Methods

    FindShaderMetallicRoughness()

    Finds the shader required for metallic/roughness based materials.

    Declaration
    protected virtual Shader FindShaderMetallicRoughness()
    Returns
    Type Description
    Shader

    Metallic/Roughness shader

    FindShaderSpecularGlossiness()

    Finds the shader required for specular/glossiness based materials.

    Declaration
    protected virtual Shader FindShaderSpecularGlossiness()
    Returns
    Type Description
    Shader

    Specular/Glossiness shader

    FindShaderUnlit()

    Finds the shader required for unlit materials.

    Declaration
    protected virtual Shader FindShaderUnlit()
    Returns
    Type Description
    Shader

    Unlit shader

    GenerateDefaultMaterial(bool)

    Creates a fallback material to be assigned to nodes without a material.

    Declaration
    protected override Material GenerateDefaultMaterial(bool pointsSupport = false)
    Parameters
    Type Name Description
    bool pointsSupport

    If true, material has to support meshes with points topology

    Returns
    Type Description
    Material

    fallback material

    Overrides
    MaterialGenerator.GenerateDefaultMaterial(bool)

    GenerateMaterial(Material, IGltfReadable, bool)

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

    Declaration
    public override 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.

    Returns
    Type Description
    Material

    Generated Unity Material

    Overrides
    MaterialGenerator.GenerateMaterial(Material, IGltfReadable, bool)

    SetAlphaModeBlend(Material)

    Configures material for alpha blending.

    Declaration
    public static void SetAlphaModeBlend(Material material)
    Parameters
    Type Name Description
    Material material

    Target material

    SetAlphaModeMask(Material, float)

    Configures material for alpha masking.

    Declaration
    public static void SetAlphaModeMask(Material material, float alphaCutoff)
    Parameters
    Type Name Description
    Material material

    Target material

    float alphaCutoff

    Threshold value for alpha masking

    SetAlphaModeTransparent(Material)

    Configures material for transparency.

    Declaration
    public static void SetAlphaModeTransparent(Material material)
    Parameters
    Type Name Description
    Material material

    Target material

    SetOpaqueMode(Material)

    Configures material to be opaque.

    Declaration
    public static void SetOpaqueMode(Material material)
    Parameters
    Type Name Description
    Material material

    Target material

    Implements

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