Search Unity

I have added support for VR Single Pass Stereo Rendering to my SSAO plugin.

Discussion in 'AR/VR (XR) Discussion' started by wilberforce, Feb 8, 2017.

  1. wilberforce

    wilberforce

    Joined:
    Aug 29, 2016
    Posts:
    92


    There is a free demo available

    I don't have access to all VR hardware, so it would help me a lot if you could try it out and see if you find any issues, I will try to fix all the problems ASAP.

    (plugin link)
     
  2. ataylor09

    ataylor09

    Joined:
    Mar 4, 2015
    Posts:
    2
    I was just about to post questions about Ssao with single pass forward rendering when I stumbled on this!!!

    I'll definitely test this with steam vr and report back. Won't be until after the weekend though
     
  3. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    201
    Tested and working good
     
  4. wilberforce

    wilberforce

    Joined:
    Aug 29, 2016
    Posts:
    92
    Recently added optimizations that increase the performance on higher resolutions which directly impacts SPSR as both eyes are rendered into one large texture.
     
  5. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    I was just looking for a solution like this for VR, as Unity's built in various modes of SSAO produce a much too "muddy" and "dirty" result when you look through a VR headset (HTC Vive tested here).

    This was much cleaner! I only noticed some "dirty" artifacts when I specifically rolled my head (to use aircraft terminology). Moving my head from side to side or up and down produced stable shadows.

    However, it added 0.5ms - 0.8ms of CPU time and a whopping 10ms - 20ms of GPU time, so that's a no no on my development machine, which has a 980ti. The software I'm making will be demonstrated on a 1080, though, which supports single pass stereo, so hopefully that will help (will test that on monday).

    I was using the default demo settings, btw. Turning the quality down yields similar "dirty" results as Unity's SSAO, which defeats the purpose of this plugin. I'm crossing my fingers that the 1080 will be able to handle 32 samples... but I haven't even added ocean shaders to the scene yet...
     
  6. wilberforce

    wilberforce

    Joined:
    Aug 29, 2016
    Posts:
    92
    Thanks for the feedback, I'll try checking the camera roll artifacts ASAP.

    But the speed measurements are really strange though - I'm getting nowhere near that for the texture sizes of HTC Vive's resolution (see attached image, rendered on GTX 970)
    2017-03-12_8-52-37.png
    Are you using some sort of supersampling/increased pixel density? If so, try downsampling the AO output ('Downsampling' option in the 'Performance settings' in the script's inspector)

    Also when comparing the output be sure to use textured image as a benchmark - early in development I spent countless hours obsessing over some small artifacts in the 'AO only' mode when there was no visual difference in the final image.
     
  7. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Yes, I'm using 1.4-1.6x supersampling.

    I'm afraid to report that doing some more research led me to Amplify AO which consumed half or even less of the render time of your plugin and it looked smoother as well, so I'm going to use that instead for this project.

    One note: The demo watermark doesn't appear in the VR headset.
     
  8. wilberforce

    wilberforce

    Joined:
    Aug 29, 2016
    Posts:
    92
    Hi, the latest version (1.6.1) should smooth things out, add more detail and fix the flickering on camera roll. The watermark should also appear correctly in VR.



    Looking forward to your reply.
     
  9. wilberforce

    wilberforce

    Joined:
    Aug 29, 2016
    Posts:
    92
    In new version (VAO 1.8) we've fixed aliasing problems in single pass stereo mode.

    fixed-jaggy-edges.jpg
     
  10. scvnathan

    scvnathan

    Joined:
    Apr 29, 2016
    Posts:
    74
    Is this compatible with 2017.2(p1)? I just tried the demo scene with my Vive on single-pass and the scene is almost entirely black. Multi-pass works fine.

    Edit: Nevermind, I think? Selecting the Camera during play mode seems to fix it
     
    Last edited: Nov 10, 2017
  11. wilberforce

    wilberforce

    Joined:
    Aug 29, 2016
    Posts:
    92
    Hi

    In single pass stereo mode, you have to enable "command buffer option" for this to work (this wasn't needed in earlier unity versions). Note that if you are using deferred rendering path, you also need to enable G-Buffers option.

    I am still figuring out a way to force this options in single pass stereo, and still give user an option to turn it off ... in case Unity will change it up again in next versions.
     
  12. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    282
    Did you have any luck with ocean shaders and single-pass rendering in VR?