Class ShaderGraphMaterialGenerator
Inheritance
ShaderGraphMaterialGenerator
Syntax
public class ShaderGraphMaterialGenerator : MaterialGenerator, IMaterialGenerator
Fields
AlphaDstBlendProperty
Shader property ID for property _AlphaDstBlend
Declaration
public static readonly int AlphaDstBlendProperty
Field Value
DisableSsrTransparentKeyword
Shader keyword _DISABLE_SSR_TRANSPARENT
Declaration
public const string DisableSsrTransparentKeyword = "_DISABLE_SSR_TRANSPARENT"
Field Value
EnableFogOnTransparentKeyword
Shader keyword _ENABLE_FOG_ON_TRANSPARENT
Declaration
public const string EnableFogOnTransparentKeyword = "_ENABLE_FOG_ON_TRANSPARENT"
Field Value
Name of the shader graph used for PBR metallic/roughness materials
Declaration
public const string MetallicShader = "glTF-pbrMetallicRoughness"
Field Value
MotionVectorsPass
MotionVector shader pass name
Declaration
public const string MotionVectorsPass = "MOTIONVECTORS"
Field Value
MotionVectorTag
MotionVector shader tag name
Declaration
public const string MotionVectorTag = "MotionVector"
Field Value
MotionVectorUser
MotionVector shader tag User value
Declaration
public const string MotionVectorUser = "User"
Field Value
ShaderPassDepthOnlyPass
Declaration
public const string ShaderPassDepthOnlyPass = "DepthOnly"
Field Value
ShaderPassRayTracingPrepass
Shader pass RayTracingPrepass
Declaration
public const string ShaderPassRayTracingPrepass = "RayTracingPrepass"
Field Value
ShaderPassTransparentBackface
Shader pass TransparentBackface
Declaration
public const string ShaderPassTransparentBackface = "TransparentBackface"
Field Value
ShaderPassTransparentDepthPostpass
Shader pass TransparentDepthPostpass
Declaration
public const string ShaderPassTransparentDepthPostpass = "TransparentDepthPostpass"
Field Value
ShaderPassTransparentDepthPrepass
Shader pass TransparentDepthPrepass
Declaration
public const string ShaderPassTransparentDepthPrepass = "TransparentDepthPrepass"
Field Value
SpecularShader
Name of the shader graph used for PBR specular/glossiness materials
Declaration
public const string SpecularShader = "glTF-pbrSpecularGlossiness"
Field Value
SurfaceTypeTransparentKeyword
Shader keyword _SURFACE_TYPE_TRANSPARENT
Declaration
public const string SurfaceTypeTransparentKeyword = "_SURFACE_TYPE_TRANSPARENT"
Field Value
TransmissionFactorProperty
Shader property ID for property transmissionFactor
Declaration
public static readonly int TransmissionFactorProperty
Field Value
TransmissionTextureProperty
Shader property ID for property transmissionTexture
Declaration
public static readonly int TransmissionTextureProperty
Field Value
UnlitShader
Name of the shader graph used for unlit materials
Declaration
public const string UnlitShader = "glTF-unlit"
Field Value
ZTestGBufferProperty
Shader property ID for property _ZTestGBuffer
Declaration
public static readonly int ZTestGBufferProperty
Field Value
Methods
ApplyTransmission(ref Color, IGltfReadable, Transmission, Material, Nullable<RenderQueue>)
Declaration
protected virtual RenderQueue? ApplyTransmission(ref Color baseColorLinear, IGltfReadable gltf, Transmission transmission, Material material, RenderQueue? renderQueue)
Parameters
Returns
ApplyTransmissionShaderFeatures(Material)
Declaration
protected virtual ShaderGraphMaterialGenerator.ShaderMode? ApplyTransmissionShaderFeatures(Material gltfMaterial)
Parameters
Type |
Name |
Description |
Material |
gltfMaterial |
|
Returns
GenerateDefaultMaterial(Boolean)
Creates a fallback material to be assigned to nodes without a material.
Declaration
protected override Material GenerateDefaultMaterial(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
|
Overrides
GenerateMaterial(Material, IGltfReadable, Boolean)
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)
|
Boolean |
pointsSupport |
If true, material has to support meshes with points topology Points
|
Returns
Type |
Description |
Material |
Generated Unity Material
|
Overrides
Declaration
protected ShaderGraphMaterialGenerator.MetallicShaderFeatures GetMetallicShaderFeatures(Material gltfMaterial)
Parameters
Type |
Name |
Description |
Material |
gltfMaterial |
|
Returns
SetAlphaModeMask(Material, Material)
Declaration
protected virtual void SetAlphaModeMask(Material gltfMaterial, Material material)
Parameters
SetDoubleSided(Material, Material)
Declaration
protected virtual void SetDoubleSided(Material gltfMaterial, Material material)
Parameters
SetShaderModeBlend(Material, Material)
Declaration
protected virtual void SetShaderModeBlend(Material gltfMaterial, Material material)
Parameters
SetShaderModeOpaque(Material, Material)
Declaration
protected virtual void SetShaderModeOpaque(Material gltfMaterial, Material material)
Parameters
SetShaderModePremultiply(Material, Material)
Declaration
protected virtual void SetShaderModePremultiply(Material gltfMaterial, Material material)
Parameters