Search Issue Tracker
By Design
Votes
0
Found in [Package]
7.5.2
Issue ID
1285618
Regression
No
[XR SDK] [URP] Temporary render texture does not bind to shader when set as global texture when using Single Pass Instanced
Reproduction steps:
1. Open the attached project ("Single Pass Instanced Temporary RT binding.zip")
2. Open SampleScene scene
3. Make sure Oculus rendering mode is set to Single Pass Instanced
4. Open Frame Debug window
5. Enter Play mode
6. In Frame Debug window select ToGreen
7. In Frame Debug window right panel select ShaderProperties
Expected result: _CopySource texture is _CopySource
Actual result: _CopySource texture is UnityDefault2D
Reproducible with: URP 7.5.2, .8.2.0, 10.2.1 (2019.4.16f1, 2020.1.16f1, 2020.2.0b17, 2021.1.0a9)
Not reproducible with: 2018.4.30f1 (XR SDK not available)
Tested:
- Oculus Rift
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:
The reason for the binding issue is that the project was using shader graph and declared CopySource as Sample Texture2D. In XR single pass instanced, the screen space textures are Texture2DArray type with array size 2. This type mismatch causes the binding to fail and unity binds UnityDefault2D as the default texture.
Usually when writing XR shaders in unity, user should use XR macros Texture2D_X for screen space textures, the macro will handle the texture type based on the selected stereo mode(SPI, multiview or multipass). ShaderGraph however does not support this XR macro yet.