diff --git a/Packages/com.deltation.toon-rp/Editor/ShaderGUI/PropertyNames.cs b/Packages/com.deltation.toon-rp/Editor/ShaderGUI/PropertyNames.cs index 65d6b3d2..23bb64b6 100644 --- a/Packages/com.deltation.toon-rp/Editor/ShaderGUI/PropertyNames.cs +++ b/Packages/com.deltation.toon-rp/Editor/ShaderGUI/PropertyNames.cs @@ -7,6 +7,7 @@ public static class PropertyNames public const string SurfaceType = "_SurfaceType"; public const string AlphaClipping = "_AlphaClipping"; + public const string AlphaToCoverage = "_AlphaToCoverage"; public const string AlphaClipThreshold = "_AlphaClipThreshold"; public const string BlendMode = "_BlendMode"; public const string BlendSrc = "_BlendSrc"; diff --git a/Packages/com.deltation.toon-rp/Editor/ShaderGraph/Targets/ToonSubTarget.cs b/Packages/com.deltation.toon-rp/Editor/ShaderGraph/Targets/ToonSubTarget.cs index bd6fb07d..69415c3c 100644 --- a/Packages/com.deltation.toon-rp/Editor/ShaderGraph/Targets/ToonSubTarget.cs +++ b/Packages/com.deltation.toon-rp/Editor/ShaderGraph/Targets/ToonSubTarget.cs @@ -69,6 +69,7 @@ public override void ProcessPreviewMaterial(Material material) material.SetFloat(PropertyNames.SurfaceType, (float) target.SurfaceType); material.SetFloat(PropertyNames.BlendMode, (float) target.AlphaMode); material.SetFloat(PropertyNames.AlphaClipping, target.AlphaClip ? 1.0f : 0.0f); + material.SetFloat(PropertyNames.AlphaToCoverage, target.AlphaToCoverage ? 1.0f : 0.0f); material.SetFloat(PropertyNames.ForceDisableFogPropertyName, !target.Fog ? 1.0f : 0.0f); material.SetFloat(PropertyNames.RenderFace, (int) target.RenderFace); material.SetFloat(PropertyNames.CastShadows, target.CastShadows ? 1.0f : 0.0f); @@ -110,6 +111,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera collector.AddFloatProperty(PropertyNames.SurfaceType, (float) target.SurfaceType); collector.AddFloatProperty(PropertyNames.BlendMode, (float) target.AlphaMode); collector.AddFloatProperty(PropertyNames.AlphaClipping, target.AlphaClip ? 1.0f : 0.0f); + collector.AddFloatProperty(PropertyNames.AlphaToCoverage, target.AlphaToCoverage ? 1.0f : 0.0f); collector.AddFloatProperty(PropertyNames.ForceDisableFogPropertyName, !target.Fog ? 1.0f : 0.0f); collector.AddFloatProperty(PropertyNames.BlendSrc, 1.0f ); // always set by material inspector, ok to have incorrect values here