docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ShaderGraphMaterialGenerator

    Inheritance
    object
    MaterialGenerator
    ShaderGraphMaterialGenerator
    HighDefinitionRPMaterialGenerator
    UniversalRPMaterialGenerator
    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.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: GLTFast.Materials
    Assembly: solution.dll
    Syntax
    public class ShaderGraphMaterialGenerator : MaterialGenerator, IMaterialGenerator

    Fields

    AlphaDstBlendProperty

    Shader property ID for property _AlphaDstBlend

    Declaration
    public static readonly int AlphaDstBlendProperty
    Field Value
    Type Description
    int

    ClearcoatNormalTextureProperty

    Shader property ID for property clearcoatNormalTexture

    Declaration
    public static readonly int ClearcoatNormalTextureProperty
    Field Value
    Type Description
    int

    ClearcoatNormalTextureRotationProperty

    Shader property ID for property clearcoatNormalTextureRotation

    Declaration
    public static readonly int ClearcoatNormalTextureRotationProperty
    Field Value
    Type Description
    int

    ClearcoatNormalTextureScaleProperty

    Shader property ID for property clearcoatNormalTexture_Scale

    Declaration
    public static readonly int ClearcoatNormalTextureScaleProperty
    Field Value
    Type Description
    int

    ClearcoatNormalTextureScaleTransformProperty

    Shader property ID for property clearcoatNormalTexture_ST

    Declaration
    public static readonly int ClearcoatNormalTextureScaleTransformProperty
    Field Value
    Type Description
    int

    ClearcoatNormalTextureTexCoordProperty

    Shader property ID for property clearcoatNormalTexture_texCoord

    Declaration
    public static readonly int ClearcoatNormalTextureTexCoordProperty
    Field Value
    Type Description
    int

    ClearcoatProperty

    Shader property ID for property clearcoatFactor

    Declaration
    public static readonly int ClearcoatProperty
    Field Value
    Type Description
    int

    ClearcoatRoughnessProperty

    Shader property ID for property clearcoatRoughnessFactor

    Declaration
    public static readonly int ClearcoatRoughnessProperty
    Field Value
    Type Description
    int

    ClearcoatRoughnessTextureProperty

    Shader property ID for property clearcoatRoughnessTexture

    Declaration
    public static readonly int ClearcoatRoughnessTextureProperty
    Field Value
    Type Description
    int

    ClearcoatRoughnessTextureRotationProperty

    Shader property ID for property clearcoatRoughnessTexture_Rotation

    Declaration
    public static readonly int ClearcoatRoughnessTextureRotationProperty
    Field Value
    Type Description
    int

    ClearcoatRoughnessTextureScaleTransformProperty

    Shader property ID for property clearcoatRoughnessTexture_ST

    Declaration
    public static readonly int ClearcoatRoughnessTextureScaleTransformProperty
    Field Value
    Type Description
    int

    ClearcoatRoughnessTextureTexCoordProperty

    Shader property ID for property clearcoatRoughnessTexture_texCoord

    Declaration
    public static readonly int ClearcoatRoughnessTextureTexCoordProperty
    Field Value
    Type Description
    int

    ClearcoatTextureProperty

    Shader property ID for property clearcoatTexture

    Declaration
    public static readonly int ClearcoatTextureProperty
    Field Value
    Type Description
    int

    ClearcoatTextureRotationProperty

    Shader property ID for property clearcoatTexture_Rotation

    Declaration
    public static readonly int ClearcoatTextureRotationProperty
    Field Value
    Type Description
    int

    ClearcoatTextureScaleTransformProperty

    Shader property ID for property clearcoatTexture_ST

    Declaration
    public static readonly int ClearcoatTextureScaleTransformProperty
    Field Value
    Type Description
    int

    ClearcoatTextureTexCoordProperty

    Shader property ID for property clearcoatTexture_texCoord

    Declaration
    public static readonly int ClearcoatTextureTexCoordProperty
    Field Value
    Type Description
    int

    DisableSsrTransparentKeyword

    Shader keyword _DISABLE_SSR_TRANSPARENT

    Declaration
    public const string DisableSsrTransparentKeyword = "_DISABLE_SSR_TRANSPARENT"
    Field Value
    Type Description
    string

    EnableFogOnTransparentKeyword

    Shader keyword _ENABLE_FOG_ON_TRANSPARENT

    Declaration
    public const string EnableFogOnTransparentKeyword = "_ENABLE_FOG_ON_TRANSPARENT"
    Field Value
    Type Description
    string

    MetallicShader

    Name of the shader graph used for PBR metallic/roughness materials

    Declaration
    public const string MetallicShader = "glTF-pbrMetallicRoughness"
    Field Value
    Type Description
    string

    MotionVectorTag

    MotionVector shader tag name

    Declaration
    public const string MotionVectorTag = "MotionVector"
    Field Value
    Type Description
    string

    MotionVectorUser

    MotionVector shader tag User value

    Declaration
    public const string MotionVectorUser = "User"
    Field Value
    Type Description
    string

    MotionVectorsPass

    MotionVector shader pass name

    Declaration
    public const string MotionVectorsPass = "MOTIONVECTORS"
    Field Value
    Type Description
    string

    ShaderPassDepthOnlyPass

    Shader pass DepthOnly

    Declaration
    public const string ShaderPassDepthOnlyPass = "DepthOnly"
    Field Value
    Type Description
    string

    ShaderPassRayTracingPrepass

    Shader pass RayTracingPrepass

    Declaration
    public const string ShaderPassRayTracingPrepass = "RayTracingPrepass"
    Field Value
    Type Description
    string

    ShaderPassTransparentBackface

    Shader pass TransparentBackface

    Declaration
    public const string ShaderPassTransparentBackface = "TransparentBackface"
    Field Value
    Type Description
    string

    ShaderPassTransparentDepthPostpass

    Shader pass TransparentDepthPostpass

    Declaration
    public const string ShaderPassTransparentDepthPostpass = "TransparentDepthPostpass"
    Field Value
    Type Description
    string

    ShaderPassTransparentDepthPrepass

    Shader pass TransparentDepthPrepass

    Declaration
    public const string ShaderPassTransparentDepthPrepass = "TransparentDepthPrepass"
    Field Value
    Type Description
    string

    SpecularShader

    Name of the shader graph used for PBR specular/glossiness materials

    Declaration
    public const string SpecularShader = "glTF-pbrSpecularGlossiness"
    Field Value
    Type Description
    string

    SurfaceTypeTransparentKeyword

    Shader keyword _SURFACE_TYPE_TRANSPARENT

    Declaration
    public const string SurfaceTypeTransparentKeyword = "_SURFACE_TYPE_TRANSPARENT"
    Field Value
    Type Description
    string

    TransmissionFactorProperty

    Shader property ID for property transmissionFactor

    Declaration
    public static readonly int TransmissionFactorProperty
    Field Value
    Type Description
    int

    TransmissionTextureProperty

    Shader property ID for property transmissionTexture

    Declaration
    public static readonly int TransmissionTextureProperty
    Field Value
    Type Description
    int

    UnlitShader

    Name of the shader graph used for unlit materials

    Declaration
    public const string UnlitShader = "glTF-unlit"
    Field Value
    Type Description
    string

    ZTestGBufferProperty

    Shader property ID for property _ZTestGBuffer

    Declaration
    public static readonly int ZTestGBufferProperty
    Field Value
    Type Description
    int

    Methods

    ApplyTransmission(ref Color, IGltfReadable, Transmission, Material, RenderQueue?)

    Declaration
    protected virtual RenderQueue? ApplyTransmission(ref Color baseColorLinear, IGltfReadable gltf, Transmission transmission, Material material, RenderQueue? renderQueue)
    Parameters
    Type Name Description
    Color baseColorLinear
    IGltfReadable gltf
    Transmission transmission
    Material material
    RenderQueue? renderQueue
    Returns
    Type Description
    RenderQueue?

    ApplyTransmissionShaderFeatures(MaterialBase)

    Declaration
    protected virtual ShaderGraphMaterialGenerator.ShaderMode? ApplyTransmissionShaderFeatures(MaterialBase gltfMaterial)
    Parameters
    Type Name Description
    MaterialBase gltfMaterial
    Returns
    Type Description
    ShaderGraphMaterialGenerator.ShaderMode?

    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)

    GetMetallicShader(MetallicShaderFeatures)

    Declaration
    protected virtual Shader GetMetallicShader(ShaderGraphMaterialGenerator.MetallicShaderFeatures features)
    Parameters
    Type Name Description
    ShaderGraphMaterialGenerator.MetallicShaderFeatures features
    Returns
    Type Description
    Shader

    GetMetallicShaderFeatures(MaterialBase)

    Declaration
    protected ShaderGraphMaterialGenerator.MetallicShaderFeatures GetMetallicShaderFeatures(MaterialBase gltfMaterial)
    Parameters
    Type Name Description
    MaterialBase gltfMaterial
    Returns
    Type Description
    ShaderGraphMaterialGenerator.MetallicShaderFeatures

    LoadShaderByName(string)

    Declaration
    protected Shader LoadShaderByName(string shaderName)
    Parameters
    Type Name Description
    string shaderName
    Returns
    Type Description
    Shader

    SetAlphaModeMask(MaterialBase, Material)

    Declaration
    protected virtual void SetAlphaModeMask(MaterialBase gltfMaterial, Material material)
    Parameters
    Type Name Description
    MaterialBase gltfMaterial
    Material material

    SetDoubleSided(MaterialBase, Material)

    Declaration
    protected virtual void SetDoubleSided(MaterialBase gltfMaterial, Material material)
    Parameters
    Type Name Description
    MaterialBase gltfMaterial
    Material material

    SetShaderModeBlend(MaterialBase, Material)

    Declaration
    protected virtual void SetShaderModeBlend(MaterialBase gltfMaterial, Material material)
    Parameters
    Type Name Description
    MaterialBase gltfMaterial
    Material material

    SetShaderModeOpaque(MaterialBase, Material)

    Declaration
    protected virtual void SetShaderModeOpaque(MaterialBase gltfMaterial, Material material)
    Parameters
    Type Name Description
    MaterialBase gltfMaterial
    Material material

    SetShaderModePremultiply(MaterialBase, Material)

    Declaration
    protected virtual void SetShaderModePremultiply(MaterialBase gltfMaterial, Material material)
    Parameters
    Type Name Description
    MaterialBase gltfMaterial
    Material 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)