Class ShaderGraphMaterialGenerator
Inheritance
ShaderGraphMaterialGenerator
Assembly: glTFast.dll
Syntax
public class ShaderGraphMaterialGenerator : MaterialGenerator, IMaterialGenerator
Fields
AlphaDstBlendProperty
Shader property ID for property _AlphaDstBlend
Declaration
public static readonly int AlphaDstBlendProperty
Field Value
ClearcoatNormalTextureProperty
Shader property ID for property clearcoatNormalTexture
Declaration
public static readonly int ClearcoatNormalTextureProperty
Field Value
ClearcoatNormalTextureRotationProperty
Shader property ID for property clearcoatNormalTextureRotation
Declaration
public static readonly int ClearcoatNormalTextureRotationProperty
Field Value
ClearcoatNormalTextureScaleProperty
Shader property ID for property clearcoatNormalTexture_Scale
Declaration
public static readonly int ClearcoatNormalTextureScaleProperty
Field Value
ClearcoatNormalTextureScaleTransformProperty
Shader property ID for property clearcoatNormalTexture_ST
Declaration
public static readonly int ClearcoatNormalTextureScaleTransformProperty
Field Value
ClearcoatNormalTextureTexCoordProperty
Shader property ID for property clearcoatNormalTexture_texCoord
Declaration
public static readonly int ClearcoatNormalTextureTexCoordProperty
Field Value
ClearcoatProperty
Shader property ID for property clearcoatFactor
Declaration
public static readonly int ClearcoatProperty
Field Value
ClearcoatRoughnessProperty
Shader property ID for property clearcoatRoughnessFactor
Declaration
public static readonly int ClearcoatRoughnessProperty
Field Value
ClearcoatRoughnessTextureProperty
Shader property ID for property clearcoatRoughnessTexture
Declaration
public static readonly int ClearcoatRoughnessTextureProperty
Field Value
ClearcoatRoughnessTextureRotationProperty
Shader property ID for property clearcoatRoughnessTexture_Rotation
Declaration
public static readonly int ClearcoatRoughnessTextureRotationProperty
Field Value
ClearcoatRoughnessTextureScaleTransformProperty
Shader property ID for property clearcoatRoughnessTexture_ST
Declaration
public static readonly int ClearcoatRoughnessTextureScaleTransformProperty
Field Value
ClearcoatRoughnessTextureTexCoordProperty
Shader property ID for property clearcoatRoughnessTexture_texCoord
Declaration
public static readonly int ClearcoatRoughnessTextureTexCoordProperty
Field Value
ClearcoatTextureProperty
Shader property ID for property clearcoatTexture
Declaration
public static readonly int ClearcoatTextureProperty
Field Value
ClearcoatTextureRotationProperty
Shader property ID for property clearcoatTexture_Rotation
Declaration
public static readonly int ClearcoatTextureRotationProperty
Field Value
ClearcoatTextureScaleTransformProperty
Shader property ID for property clearcoatTexture_ST
Declaration
public static readonly int ClearcoatTextureScaleTransformProperty
Field Value
ClearcoatTextureTexCoordProperty
Shader property ID for property clearcoatTexture_texCoord
Declaration
public static readonly int ClearcoatTextureTexCoordProperty
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
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
MotionVectorsPass
MotionVector shader pass name
Declaration
public const string MotionVectorsPass = "MOTIONVECTORS"
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, RenderQueue?)
Declaration
protected virtual RenderQueue? ApplyTransmission(ref Color baseColorLinear, IGltfReadable gltf, Transmission transmission, Material material, RenderQueue? renderQueue)
Parameters
Returns
ApplyTransmissionShaderFeatures(MaterialBase)
Declaration
protected virtual ShaderGraphMaterialGenerator.ShaderMode? ApplyTransmissionShaderFeatures(MaterialBase gltfMaterial)
Parameters
Returns
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
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
Declaration
protected virtual Shader GetMetallicShader(ShaderGraphMaterialGenerator.MetallicShaderFeatures features)
Parameters
Returns
Declaration
protected ShaderGraphMaterialGenerator.MetallicShaderFeatures GetMetallicShaderFeatures(MaterialBase gltfMaterial)
Parameters
Returns
LoadShaderByGuid(GUID)
Declaration
protected static Shader LoadShaderByGuid(GUID guid)
Parameters
Type |
Name |
Description |
GUID |
guid |
|
Returns
LoadShaderByName(string)
Declaration
protected Shader LoadShaderByName(string shaderName)
Parameters
Type |
Name |
Description |
string |
shaderName |
|
Returns
SetAlphaModeMask(MaterialBase, Material)
Declaration
protected virtual void SetAlphaModeMask(MaterialBase gltfMaterial, Material material)
Parameters
SetDoubleSided(MaterialBase, Material)
Declaration
protected virtual void SetDoubleSided(MaterialBase gltfMaterial, Material material)
Parameters
SetShaderModeBlend(MaterialBase, Material)
Declaration
protected virtual void SetShaderModeBlend(MaterialBase gltfMaterial, Material material)
Parameters
SetShaderModeOpaque(MaterialBase, Material)
Declaration
protected virtual void SetShaderModeOpaque(MaterialBase gltfMaterial, Material material)
Parameters
SetShaderModePremultiply(MaterialBase, Material)
Declaration
protected virtual void SetShaderModePremultiply(MaterialBase gltfMaterial, Material material)
Parameters
Implements