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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
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.