From 6fca6390209d947236d99749df1c06b3cb391bfd Mon Sep 17 00:00:00 2001 From: doodlum <15017472+doodlum@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:59:41 +0100 Subject: [PATCH] fix: tree skylighting darkness (#554) --- package/Shaders/Lighting.hlsl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index 715ad2111..561e21b55 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -1915,7 +1915,13 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(SOFT_LIGHTING) || defined(BACK_LIGHTING) || defined(RIM_LIGHTING) if (dirLightAngle > 0.0) # endif + { dirDetailShadow = ScreenSpaceShadows::GetScreenSpaceShadow(input.Position, screenUV, screenNoise, viewPosition, eyeIndex); +# if defined(TREE_ANIM) + PerGeometry sD = SharedPerShadow[0]; + dirDetailShadow = lerp(1.0, dirDetailShadow, saturate(viewPosition.z / sqrt(sD.ShadowLightParam.z))); +# endif + } # endif # if defined(EMAT) && (defined(SKINNED) || !defined(MODELSPACENORMALS)) @@ -2358,6 +2364,8 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace # if defined(HAIR) float3 vertexColor = lerp(1, TintColor.xyz, input.Color.y); +# elif defined(TREE_ANIM) && defined(SKYLIGHTING) + float3 vertexColor = 1.0; # else float3 vertexColor = input.Color.xyz; # endif // defined (HAIR)