Search Issue Tracker
By Design
Votes
5
Found in [Package]
7.1.7
Issue ID
1204801
Regression
No
[URP] Clear(color) and Draw Mesh methods called for each Sorting Layer
Reproduction steps:
1. Open project in "MyRepro.zip"
2. Open Scene "0a18.unity"
3. Notice that UniversalRP-HighQuality is using 2D Renderer Data (Assets -> Settings)
4. Notice that all 3 Sprites are in Sorting Layer "Default"
5. Notice that Point Lights affect all 3 Sorting Layers
6. Open Frame Debugger and enable it (Windows -> Analysis -> Frame Debugger)
Expected result: Draw Mesh method gets called once per Light
Actual result: Draw Mesh method gets called for each Sorting Layer, deleting previously drawn Lights and drawing them again
Reproducible with: URP 6.9.2 (2019.2.18f1), URP 7.1.7 (2019.3.0f4, 2020.1.0a18)
Could not test with 2018.4 (No 2D Renderer Data)
Note: even if none of the Sprites are using that Sorting Layer the Light still will call Clear (color) and Draw Mesh. The result that's left will be what stays after the last Draw
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
- Red spots appear when Blending Lighting Scenarios using Adaptive Probe Volumes
- [Windows] About Unity Window needs to be opened twice to adapt to resolution
- NullReferenceException and temporary graph corruption after entering playmode if output node connection was changed
- Sprite Renderer with Animation does not reflect Sprite changes in the Scene when switching Mask Interaction
- Error "NullReferenceException: Object reference not set to an instance of an object" is present when loading 3D text mesh in Player from an asset bundle that is built with an older Editor version
Resolution Note:
This is how the 2D lighting system is currently designed to work. We know it's not optimal when every sorting layer has an identical set of lights, and are looking into ways we can merge layers in this situation. However, we don't consider the current behavior a bug. We'll be tracking this issue with our project planning tool instead.