Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2020.3
2020.3.19f1
2021.2
2022.1
Issue ID
1369884
Regression
No
[Quest] Sampling depth texture from surface shader is incorrect in VR with Multi-View
Reproduction steps:
1. Open project "DepthBugSurfaceShader.zip"
2. Open "Scene.unity" found in Assets/BugRepro
3. Build the project and run on Oculus Quest
Expected result: The blue cube looks the same as in Editor
Actual result: The blue cube is misaligned with the red cube and has an incorrect depth position
Reproducible with: 1.11.0 (2019.4.33f1, 2020.3.24f1, 2021.2.1f1, 2022.1.0b1)
Tested with:
Oculus (Quest 2), Android 10, CPU: Snapdragon XR2, GPU: Adreno (TM) 650
Notes:
The bug is not reproducible when rendering mode is set to Multi-Pass
Built-in renderer
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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
Multiview mode for XR rendering requires a different approach for reading screen-space textures (including depth maps). Specifically, multiview mode renders to a texture array, often with different projections. As such, the application needs to render (or copy) the depth into a texture array (declared as a UNITY_DECLARE_SCREENSPACE_TEXTURE in the shader), and sample that using UNITY_SAMPLE_SCREENSPACE_TEXTURE. Those shader macros are XR aware and will resolve to the approprate declaration and sampler for either monoscopic or stereo rendering.