From 64b291f83a5d782b49c54b019f5735d2cc3d264e Mon Sep 17 00:00:00 2001 From: Niko Wissmann Date: Mon, 13 Dec 2021 15:24:25 +0100 Subject: [PATCH 1/2] Fix shader mode selection for glTF MASK mode --- Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs b/Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs index 74872057..987ee719 100644 --- a/Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs +++ b/Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs @@ -477,7 +477,7 @@ protected MetallicShaderFeatures GetMetallicShaderFeatures(Schema.Material gltfM if (gltfMaterial.doubleSided) feature |= MetallicShaderFeatures.DoubleSided; if (!sm.HasValue) { - sm = gltfMaterial.alphaModeEnum != AlphaMode.OPAQUE ? ShaderMode.Blend : ShaderMode.Opaque; + sm = gltfMaterial.alphaModeEnum != AlphaMode.OPAQUE ? gltfMaterial.alphaModeEnum == AlphaMode.BLEND ? ShaderMode.Blend : ShaderMode.Opaque : ShaderMode.Opaque; } feature |= (MetallicShaderFeatures)sm; From 5e727ca2aad940470af6a14ae9fd42824c284072 Mon Sep 17 00:00:00 2001 From: Niko Wissmann Date: Thu, 16 Dec 2021 14:06:44 +0100 Subject: [PATCH 2/2] Improve shading mode bool statement --- Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs b/Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs index 987ee719..1e6200d0 100644 --- a/Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs +++ b/Runtime/Scripts/Material/ShaderGraphMaterialGenerator.cs @@ -477,7 +477,7 @@ protected MetallicShaderFeatures GetMetallicShaderFeatures(Schema.Material gltfM if (gltfMaterial.doubleSided) feature |= MetallicShaderFeatures.DoubleSided; if (!sm.HasValue) { - sm = gltfMaterial.alphaModeEnum != AlphaMode.OPAQUE ? gltfMaterial.alphaModeEnum == AlphaMode.BLEND ? ShaderMode.Blend : ShaderMode.Opaque : ShaderMode.Opaque; + sm = gltfMaterial.alphaModeEnum == AlphaMode.BLEND ? ShaderMode.Blend : ShaderMode.Opaque; } feature |= (MetallicShaderFeatures)sm;