Single-Pass Stereo Rendering - Delayed Directional Light Shadows

Not sure if anyone else has experienced this - but when I have a directional light casting shadows in a VR scene in Unity 5.4B19 with Single-Pass Stereo Rendering enabled, the shadows lag behind by about half a second relative to my head movement in the scene. It has the effect of the shadow being “out of phase” with the motion in the scene. The shadow looks fine when not moving and the issue only presents itself when motion is introduced.

Otherwise, my scene is rendering at 90fps+ without any real issue.

I’m using an HTC Vive with a Radeon R9 390 on my dev box.

My Rendering settings are:

  • Forward rendering path
  • Static Batching enabled
  • Dynamic Batching enabled
  • GPU Skinning enabled
  • Virtual Reality Supported enabled
  • Single-Pass Stereo Rendering enabled

Shadows:
Hard and Soft Shadows
Medium Resolution
Stable Fit
Shadow Distance: 150
Four Cascades

Render quality:
Pixel Light Count: 4
Tex Quality: Full
Aniso Tex: Forced On
4x MSAA
Soft Particles: off
Realtime reflection: enabled

Reading through the threads I see others are having issues with the Single-Pass Stereo Renderer. I definitely want to keep using it as it improves performance considerably.

Thanks

Hi UniPete,

Thanks for the detailed report!

I believe this is an issue I have seen with directional light + forward rendering + singlepass stereo. The fix is verified on our devs branch and will be coming to 5.4 ASAP.

If you think you are seeing a different issue please submit a bug report and I will take a closer look.

Thanks,

Will J
Unity QA

1 Like

That’s great news! Thanks for the quick update Will - Look forward to testing the next release.

I get this to on 5.4 b21 and 5.4B22. Problem is if i do not have the Single pass option checked particle effects like

Renders at incorrect depths

Nvidia Shadowplay was actually able to capture the bug, so here it is. (Same in b21 and b22)

Experiencing this issue on b21 with forward rendering, directional light and singlepass. Like @AndersMalmgren I can capture it on video.

It also seems to affect the application of post effects. I updated the atmospheric scattering effect we use to properly transform source texture UV coordinates for single-pass stereo, which works, but it seems to be reading from a delayed depth buffer or something. It looks like this when I move my head, you can see the effect is misaligned at the horizon:

On b22 the directional light shadows are working perfectly for me, but my post effect is completely broken no matter what UV coordinates I use when sampling the source texture. A simple pass-through shader doesn’t work. Even if I just output half4(1,0,0,1) from the fragment shader, which should turn the screen red, I get mostly black with particle geometry leaving ghost images. Turning the effect off returns rendering to normal. This problem was fixed for me in b21 with the change in UV handling.

Same here, not much to add.