Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Single-Pass Stereo Rendering - Delayed Directional Light Shadows

Discussion in '5.4 Beta' started by UniPete, May 31, 2016.

  1. UniPete

    UniPete

    Joined:
    May 28, 2016
    Posts:
    2
    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
     
  2. williamj

    williamj

    Unity Technologies

    Joined:
    May 26, 2015
    Posts:
    94
    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
     
    UniPete likes this.
  3. UniPete

    UniPete

    Joined:
    May 28, 2016
    Posts:
    2
    That's great news! Thanks for the quick update Will - Look forward to testing the next release.
     
  4. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Nvidia Shadowplay was actually able to capture the bug, so here it is. (Same in b21 and b22)

     
  6. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    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.

     
    Last edited: Jun 22, 2016
  7. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    Same here, not much to add.