Search Issue Tracker
By Design
Votes
3
Found in [Package]
12.0.0
Issue ID
1375862
Regression
Yes
Enabling Depth Texture on URP settings breaks rendering on the Metal platform
How to reproduce:
1. Open project "iOSShaderGlitchIssue-2021.2.zip"
2. Go to Build Settings (Edit>Build Settings) and build project for Mac standalone or iOS
3. Open the Mac standalone build or open Xcode and build for a device
4. Observe the view
5. Go to Assets>Settings>UniversalRP-HighQuality.asset and check "Depth Texture"
6. Again go to Build Settings (Edit>Build Settings) and build for Mac standalone or iOS
3. Open the Mac standalone build or open Xcode and build for a device
8. Observe the view
Expected result: The "cloud" model appears with grey textures
Actual result: The "cloud" model textures are glitched
Reproducible with: 12.0.0, (2021.2.0b15), 12.1.0 (2021.2.0b16), 13.0.0 (2022.1.0a12)
Not reproducible with: 11.0.0 (2021.1.25f1)
Could not test with: 2019.4.31f1 (Errors: "Library/PackageCache/com.unity.collab-proxy@1.13.5/Editor/Collaborate/Models/Providers/Collab.cs(108,22): error CS1061: 'Collab' does not contain a definition for 'ChangeItemsChanged' and no accessible extension method 'ChangeItemsChanged' accepting a first argument of type 'Collab' could be found (are you missing a using directive or an assembly reference?)"), 2020.3.20f1 (Errors with "com.unity.feature.development")
Notes:
- In the Mac standalone build the model textures were a different color than in the Scene view, but in the iOS build (iPhone) the textures were glitched
- In the iPad, the "cloud" model wasn't rendered at all
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
- Skinned Mesh Renderer with multiple Animator Components does not render when "Optimize Game Objects" is enabled
- [iOS]Certain characters are not displayed when using iOS devices with 18 OS and newer
- Trees do not render in 'Unity Terrain - URP Demo Scene'
- Silent crash when clicking in Scene View in a specific project
- The Player renders black on a Quest headset when MSAA, Post Processing, and Spacewarm depth submission are enabled
Resolution Note:
Behaviour of the Depth Texture has changed slightly and the current exhibited problems are due to undefined behaviour, which is trying to access _CameraDepthTexture within DrawOpaque Pass, when the texture is only generated after it (or transparent pass depending on the option selected).
To fix this issue there are two ways:
a) Render the objects that need _CameraDepthTexture in the Transparents pass (meaning change the RenderQueue in the material to be 3000 or more). As even now in the NoRepro image
b) Enable Depth Priming to create _CameraDepthTexture before the Opaques pass. However, this is not an ideal solution, as it's really not recommended to use it on mobile devices due to heavy performance impact and also it changes rendering DepthState of opaque objects, so might need some additional adjustments as the objects in this particular scene use custom shaders which depend on that