Search Issue Tracker

By Design

Votes

1

Found in

2021.3.29f1

2022.3.7f1

2023.1.8f1

2023.2.0b4

Issue ID

UUM-46017

Regression

No

[URP] Some lights and shadows are not visible when light.shadowAttenuation is used with custom shadow shader

--

-

Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/DevDunkStudio/LightReceiver/Demo/Scene/LightReceiverDemo.unity” Scene
3. Enter the Play Mode
4. Open the Scene view and observe the light shadows

Expected result: All lights with shadows are visible
Actual result: Some lights with shadows are not visible

Reproducible with: 2021.3.29f1, 2022.3.7f1, 2023.1.8f1, 2023.2.0b4

Testing environment: Windows 10 Enterprise 21H2

Notes:
- When certain lights get culled others suddenly get shadows casting
- With Forward, culling is managed by the per-object light limit, but with Forward+ there is no way to manage this
- The project uses a custom shader, which receives lighting and shadow data in an unlit shader graph
- light.distanceAttenuation works perfectly fine
- light.shadowAttenuation does not always work and cannot be used with many lights at once
- The line used in the demo Scene is CustomLighting.hlsl line 86 (AdditionalLights_half)
- Changing shadow properties and running it on my target device (android) does not change anything
- Reproduces with Windows Standalone Platform

  1. Resolution Note:

    This is by design. The scene contains 10 point lights and one spotlight. The reason for this issue is because there isn't enough space in the Shadow Atlas for all of these lights. Increasing the Atlas resolution and lowering the shadow resolution for each light can help but with this many lights this will always be a issue. Changing some of the lights to Spot Lights would also help.

    It's in our backlog to offer an option for bigger shadow atlases and to improve the shadow atlas packing, which will help in these cases.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.