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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
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.