Skip to content

Commit 47bd6c2

Browse files
Fix issue with shadow mask and area lights (#3019)
* Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]>
1 parent 77bae01 commit 47bd6c2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3434
- Fixed Clearcoat on Stacklit or Lit breaks when URP is imported into the project (case 1297806)
3535
- Fixed timing issues with accumulation motion blur
3636
- Fixed an issue with the frame count management for the volumetric fog (case 1299251).
37+
- Fixed issue with shadow mask and area lights.
3738

3839
### Changed
3940
- Removed the material pass probe volumes evaluation mode.

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,11 @@ SHADOW_TYPE EvaluateShadow_RectArea( LightLoopContext lightLoopContext, Position
481481
#ifndef LIGHT_EVALUATION_NO_SHADOWS
482482
float shadow = 1.0;
483483
float shadowMask = 1.0;
484-
float NdotL = dot(N, L); // Disable contact shadow and shadow mask when facing away from light (i.e transmission)
485484

486485
#ifdef SHADOWS_SHADOWMASK
487486
// shadowMaskSelector.x is -1 if there is no shadow mask
488487
// Note that we override shadow value (in case we don't have any dynamic shadow)
489-
shadow = shadowMask = (light.shadowMaskSelector.x >= 0.0 && NdotL > 0.0) ? dot(BUILTIN_DATA_SHADOW_MASK, light.shadowMaskSelector) : 1.0;
488+
shadow = shadowMask = (light.shadowMaskSelector.x >= 0.0) ? dot(BUILTIN_DATA_SHADOW_MASK, light.shadowMaskSelector) : 1.0;
490489
#endif
491490

492491
// When screen space shadows are not supported, this value is stripped out as it is a constant.

0 commit comments

Comments
 (0)