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

  1. 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.

Add comment

Log in to post comment