Search Issue Tracker
By Design
Votes
7
Found in
2020.3.41f1
2021.3.14f1
2022.1.24f1
2022.2.1f1
2023.1.0a21
2023.3.0a4
Issue ID
UUM-21404
Regression
No
CopyDepth pass fails when Renderer Feature is requiring Depth and Normals
Steps to reproduce:
1. Open the “CopyDepthPass_Bug” project
2. Observe the Game view
Expected result: The cube is not blurry
Actual result: The cube is blurry
Reproducible with: 2020.3.41f1, 2021.3.14f1, 2022.1.24f1, 2022.2.1f1, 2023.1.0a21
Reproduced on: macOS Ventura 13.0.1 (Intel)
Notes:
- The cube is blurry because when there’s a custom renderer feature, it seems to break to CopyDepth pass depending on the requested ScriptableRenderPassInput
- The cube is not blurry when the “TransparentMaterial” Material Surface Type is set to opaque
-
Sabrino
Dec 16, 2022 11:23
This bug causes a lot of issues with transparency and post-processing fx like depth of field. Need a fix for at least 2021 LTS onwards.
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 behaving as expected, the reason is the way the URP renderer handles the CameraDepthTexture.
The main issue, in a nutshell, is that URP can produce the CameraDepthTexture in 2 ways: via CopyDepth, or via DepthPrepass.
In your specific case, since you have a render feature, injected BeforeOpaque, this causes a DepthPrepass (or DepthNormalPrepass when requiring the normals too) to replace the CopyDepth. URP will never perform both a DepthPrepass pass and a CopyDepth pass per camera in the same frame.
The reason why in your current frame debugger capture you cannot see the DepthPrepass running instead of the CopyDepth pass is that this particular
scene has no standard geometry, except the one assigned to the layer rendered by the RenderObjects pass.
Just adding a simple 3D cube to the scene will cause the depth prepass to run and to show in the frame debugger.
The following is an explanation of what causes Depth/Normal prepasses to replace CopyPass passes:
- a pass running BeforeOpaque requests depth. If the pass requests only depth and would run AfterOpaque, then the CopyPass will still happen.
- a pass runninr at any point in the frame requires "Normal" input: the only way for URP to generate the normals texture (in the forward renderer)
is via DepthNormalPrepass.
In general, if in your specific use case it is necessary to have both a pass that requires "Normal" as input, and at the same time a CopyDepth is required to happen after Opaque,
the only option is for you to implement a custom copy depth as render feature.