Custom ShaderGraph shader in skybox breaks single pass instanced rendering

Running a plain vanilla project in Unity 2020.3.0f1 with URP version 10.3.2. I created a simple gradient shader in shadergraph and set it as the skybox material in the example scene.

Here’s the shader:

On both an Oculus Rift S and Quest 2 via Link, it works fine on multipass rendering but as soon as I switch to single pass instanced I get this:

7019431--830983--URP_SPI_Issue.gif

URP version 7.5.2 seems to not have this problem. Is this a known issue?

EDIT: Also verified this happens on Unity 2021.1.2f1 and URP 11.0.0. Looks like it first broke in URP 10.1.0

1 Like

Have you found a fix? I’ve been running into this as well and been having a difficult time finding a solution, this is one of the first threads I’ve come across that’s a 100% replica of my issue.

Switching Stereo Rendering Mode to Multi-pass under XR Plug-in Management > OpenVR seems to work like you noted. Though this shouldn’t have to be the only solution, as Single Pass Instanced is much more performant.

Any updates on this? I am having this issue as well.

bump

Also bumping this, this single bug prevents any custom skybox from working in VR without switching to Multi-pass VR rendering

Bump

Edit: Found another thread with a similar problem. HLSL (or ShaderGraph) Skybox Shader with Single Pass Instancing looks like your skybox shader is zclipping due to incorrect scaling while using single pass instancing, disabling zclipping for your skybox shader should fix it (it did in my case). I hope this gets fixed in a future release of URP

1 Like

I see, really appreciate the heads up! However, how would you apply this fix for a skybox shader made with shadergraph?

Bump

Still haven’t found a good solution, bug remains

If shadergraph has zwrite/ztest options you can change it there. If it does not, you can always export it as a .shader file and add them in yourself. Look up the unity docs for ztest and zwrite, its easy to add in.