Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.39f1
2022.3.31f1
6000.0.4f1
Issue ID
UUM-73286
Regression
No
GameObject does not receive light but casts shadows when setting Light.renderingLayerMask in Play Mode
Reproduction steps:
1. Open the “ReproProject“ project
2. Open the “Assets/Scenes/SampleScene“ scene
3. Enter Play Mode
4. Observe the Game View
Expected result: The sphere receives light and casts a shadow
Actual result: The sphere casts a shadow but does not receive light
Reproducible with: 2021.3.39f1, 2022.3.31f1, 6000.0.4f1
Reproducible on: Windows 11 Pro (22H2)
Not reproducible on: No other environment tested
Notes:
1. Changing the Rendering Layers to “Light Layer 1” manually in the Inspector window for the “Directional Light” GameObject does not reproduce this issue
2. When changing the Rendering Layers to “Light Layer 1” manually, and then removing the “Light Layer 1” LayerMask makes the shadow of the sphere disappear
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
Hi, thank you for the report.
It would appear this is not documented correctly, but you will need to set the mask on directionalLight.gameObject.GetComponent<UniversalAdditionalLightData>().renderingLayers instead of directionalLight.renderingLayerMask in your script when using URP.
I hope this resolves your issue.