Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2021.3.26f1
2022.2.21f1
2022.3.0f1
2023.1.0b19
2023.2.0a17
Issue ID
UUM-37541
Regression
No
Artifacts are visible when using the depth buffer projection with MSAA and Depth Priming
Reproduction steps:
1. Open the attached “ASDQWE” project
2. Open the “Assets/Scenes/SampeScene.unity” Scene
3. Enter the Play Mode
4. Observe the Game View
Expected result: The red square looks constantly the same
Actual result: The red square contains artifacts when the camera moves closer to it and when it moves away - the square becomes semi-transparent
Reproducible with: 2021.3.26f1, 2022.2.21f1, 2022.3.0f1, 2023.1.0b19, 2023.2.0a17
Could not test with: 2020.3.48f1 (Assets could not migrate correctly)
Reproducible on: Intel MacOS 13.3.1
Note: For the reproduction to occur these settings need to be enabled:
- In the “Assets/Settings/URP-Balanced.asset” asset, Quality > Anti Aliasing (MSAA) > 2x (or greater)
- In the “Assets/Settings/URP-Balanced-Renderer.asset” asset, Rendering > Depth Priming Mode > Forced (or auto)
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
Enabling depth priming, causes the opaque pass to reuse the depth from the depth prepass and override all the opaque objects depth states to Equal (from LessEqual) in order to be able to reuse the existing depth texture as depth buffer. So your decal depth "always" op is overridden by "equal" which causes z-fighting.
If you need to use depth priming, you should move your material to the transparent queue, that will make sure that depth priming opaque pass depthOp override doesn't affect your material.
If you enabled depth priming just as a way to force a depth prepass, there is a better and cheaper (perf wise) way of doing that: in URP asset enable "Depth Texture", in the URP Renderer Data set "Depth Texture Mode" to "Force Prepass", this will still run a depth prepass but the depth state of your custom material will be preserved
Resolution Note (2023.2.X):
Enabling depth priming, causes the opaque pass to reuse the depth from the depth prepass and override all the opaque objects depth states to Equal (from LessEqual) in order to be able to reuse the existing depth texture as depth buffer. So your decal depth "always" op is overridden by "equal" which causes z-fighting.
If you need to use depth priming, you should move your material to the transparent queue, that will make sure that depth priming opaque pass depthOp override doesn't affect your material.
If you enabled depth priming just as a way to force a depth prepass, there is a better and cheaper (perf wise) way of doing that: in URP asset enable "Depth Texture", in the URP Renderer Data set "Depth Texture Mode" to "Force Prepass", this will still run a depth prepass but the depth state of your custom material will be preserved