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
- 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:
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.