diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index bfa4b3205..78bcb5b88 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -1556,7 +1556,8 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float4 shadowColor = 1.0; if (PixelShaderDescriptor & _DefShadow && (PixelShaderDescriptor & _ShadowDir) || numShadowLights > 0) { baseShadowUV = input.Position.xy * DynamicResolutionParams2.xy; - float2 shadowUV = min(float2(DynamicResolutionParams2.z, DynamicResolutionParams1.y), max(0.0.xx, DynamicResolutionParams1.xy * (baseShadowUV * VPOSOffset.xy + VPOSOffset.zw))); + float2 adjustedShadowUV = baseShadowUV * VPOSOffset.xy + VPOSOffset.zw; + float2 shadowUV = GetDynamicResolutionAdjustedScreenPosition(adjustedShadowUV); shadowColor = TexShadowMaskSampler.Sample(SampShadowMaskSampler, shadowUV); }