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.AlphaCutoffProperty
    MaterialGenerator.BaseColorProperty
    MaterialGenerator.BaseColorTextureProperty
    MaterialGenerator.BaseColorTextureRotationProperty
    MaterialGenerator.BaseColorTextureScaleTransformProperty
    MaterialGenerator.BaseColorTextureTexCoordProperty
    MaterialGenerator.CullModeProperty
    MaterialGenerator.CullProperty
    MaterialGenerator.DstBlendProperty
    MaterialGenerator.DiffuseFactorProperty
    MaterialGenerator.DiffuseTextureProperty
    MaterialGenerator.DiffuseTextureScaleTransformProperty
    MaterialGenerator.DiffuseTextureRotationProperty
    MaterialGenerator.DiffuseTextureTexCoordProperty
    MaterialGenerator.EmissiveFactorProperty
    MaterialGenerator.EmissiveTextureProperty
    MaterialGenerator.EmissiveTextureRotationProperty
    MaterialGenerator.EmissiveTextureScaleTransformProperty
    MaterialGenerator.EmissiveTextureTexCoordProperty
    MaterialGenerator.GlossinessFactorProperty
    MaterialGenerator.NormalTextureProperty
    MaterialGenerator.NormalTextureRotationProperty
    MaterialGenerator.NormalTextureScaleTransformProperty
    MaterialGenerator.NormalTextureTexCoordProperty
    MaterialGenerator.NormalTextureScaleProperty
    MaterialGenerator.MetallicProperty
    MaterialGenerator.MetallicRoughnessMapProperty
    MaterialGenerator.MetallicRoughnessMapScaleTransformProperty
    MaterialGenerator.MetallicRoughnessMapRotationProperty
    MaterialGenerator.MetallicRoughnessMapUVChannelProperty
    MaterialGenerator.OcclusionTextureProperty
    MaterialGenerator.OcclusionTextureStrengthProperty
    MaterialGenerator.OcclusionTextureRotationProperty
    MaterialGenerator.OcclusionTextureScaleTransformProperty
    MaterialGenerator.OcclusionTextureTexCoordProperty
    MaterialGenerator.RoughnessFactorProperty
    MaterialGenerator.SpecularFactorProperty
    MaterialGenerator.SpecularGlossinessTextureProperty
    MaterialGenerator.SpecularGlossinessTextureScaleTransformProperty
    MaterialGenerator.SpecularGlossinessTextureRotationProperty
    MaterialGenerator.SpecularGlossinessTextureTexCoordProperty
    MaterialGenerator.SrcBlendProperty
    MaterialGenerator.ZWriteProperty
    MaterialGenerator.GetDefaultMaterialGenerator()
    MaterialGenerator.Logger
    MaterialGenerator.GetDefaultMaterial(bool)
    MaterialGenerator.FindShader(string, ICodeLogger)
    MaterialGenerator.SetLogger(ICodeLogger)
    MaterialGenerator.TrySetTexture(TextureInfoBase, 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: GLTFast.Materials
    Assembly: glTFast.dll
    Syntax
    public class BuiltInMaterialGenerator : MaterialGenerator, IMaterialGenerator

    Methods

    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(MaterialBase, 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(MaterialBase gltfMaterial, IGltfReadable gltf, bool pointsSupport = false)
    Parameters
    Type Name Description
    MaterialBase 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(MaterialBase, 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 © 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)