From 69d629df4137f7ee3cbb3816cc1fa40541fda1c3 Mon Sep 17 00:00:00 2001 From: Vladislav Kantaev Date: Tue, 11 Jan 2022 11:04:39 +0300 Subject: [PATCH] Force normalize normal in fragment shader --- .../DELTation/ToonShader/Shaders/ToonShaderForwardPass.hlsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderForwardPass.hlsl b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderForwardPass.hlsl index 44ce852..2288ea4 100644 --- a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderForwardPass.hlsl +++ b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderForwardPass.hlsl @@ -143,7 +143,8 @@ half4 frag(const v2f input) : SV_Target half3 normal_ws = input.normalWS; #endif - normal_ws = NormalizeNormalPerPixel(normal_ws); + normal_ws = normalize(normal_ws); + const half3 light_direction_ws = normalize(main_light.direction); const float3 position_ws = input.positionWSAndFogFactor.xyz; const half3 view_direction_ws = SafeNormalize(GetCameraPositionWS() - position_ws);