Search Issue Tracker
Fixed in 7.1.8
Votes
0
Found in [Package]
6.7.1, 7.1.2
Issue ID
1197338
Regression
Yes
[URP] Light and shadows behind Objects are rendered on top when Shadow Cascades are enabled & using Renderer Features to render
Reproduction steps:
1. Create a new URP/LWRP template project
2. Create a GameObject along with a new Layer
3. Assign that Layer to newly created GameObject
4. In Forward Renderer remove that Layer from Default Layer Mask
5. Using Forward Renderer create a Renderer Feature specifically for that Layer
Expected result: Object will be rendered at different time, but visibly, nothing will change
Actual result: Any light or shadows behind the Object is rendered on top of it
Reproducible with: URP 6.7.1 (2019.2.0a10), URP 6.9.2 (2019.2.13f1), URP 7.1.2 (2019.3.0b11, 2020.1.0a13)
Not reproducible with LWRP 4.1.0.0 (2018.4.13f1)
Could not test with: 2019.2.0a1: 2019.2.0a9, because could not create a Forward Renderer
Notes:
1. Shadow Cascades have to be enabled (2 or 4) on Pipeline Asset in use to reproduce the issue
2. Forward Renderer is not always created and assigned in Pipeline Asset by default (depends on version)
3. LWRP versions 6.5.2 & 6.5.3 allows you to create Forward Renderer, but you are unable to create Renderer Features. Could not test if the issue reproduces on these versions
4. This seems to be package specific because when using same Unity versions the bug does not repro using LWRP 6.5.3, but repros using 6.7.1 (f.e. 2019.2.0b1)
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
- UI Toolkit throws warning and fails to clear references when fields are not typed as UnityEngine.Object
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
Resolution Note (fix version 7.1.8):
The object rendered with the RenderObjectFeature is only being rendered at the Event, and it is not being injected into the Depth Prepass (it happens when you turn on shadow cascade). This is why the things behind it are being rendered on top.
RenderObjectFeature is still in experimental and will be expanding the features, including be able to inject the rendering into multiple shader passes / rendering events. So by-design for now.