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
- Shader Graph Asset icon is not shown on creation unless you confirm the name
- APV Sky occlusion doesn't consider the terrain
- [iOS] "EXC_BAD_ACCESS" Player crash when Script Debugging is enabled
- Cursor skips input fields when tabbing between two sets of input fields
- "Shader error redefinition of 'Varyings'" error appears when selecting the shader
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.