From 27015273d647e831e612f929bae1efcd59f3f13b Mon Sep 17 00:00:00 2001 From: Vladislav Kantaev Date: Thu, 13 Jan 2022 23:44:11 +0300 Subject: [PATCH 1/2] Add shadow fade to get_main_light --- .../ToonShader/Shaders/ToonShaderUtilsV2f.hlsl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderUtilsV2f.hlsl b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderUtilsV2f.hlsl index b226693..0c332b8 100644 --- a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderUtilsV2f.hlsl +++ b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderUtilsV2f.hlsl @@ -29,7 +29,16 @@ inline Light get_main_light(in v2f input SHADOW_MASK_PARAM) #ifdef USE_SHADOW_MASK return GetMainLight(shadow_coord, input.positionWSAndFogFactor.xyz, shadow_mask); #else - return GetMainLight(shadow_coord); + + // ReSharper disable once CppLocalVariableMayBeConst + Light light = GetMainLight(shadow_coord); + + #ifdef MAIN_LIGHT_CALCULATE_SHADOWS + light.shadowAttenuation = lerp(light.shadowAttenuation, 1, GetShadowFade(input.positionWSAndFogFactor.xyz)); + #endif + + return light; + #endif } From d8ed60ce01289490c6d229297d33d17984bf40fa Mon Sep 17 00:00:00 2001 From: Vladislav Kantaev Date: Thu, 13 Jan 2022 23:48:19 +0300 Subject: [PATCH 2/2] Bump version --- Packages/com.deltation.toon-shader/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.deltation.toon-shader/package.json b/Packages/com.deltation.toon-shader/package.json index 0cd98ae..3cd51ba 100644 --- a/Packages/com.deltation.toon-shader/package.json +++ b/Packages/com.deltation.toon-shader/package.json @@ -2,7 +2,7 @@ "name": "com.deltation.toon-shader", "displayName": "Toon Shader", "description": "Stylized toon shader for URP.", - "version": "0.4.6", + "version": "0.4.7", "unity": "2020.3", "dependencies": { "com.unity.render-pipelines.universal": "10.3.2"