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

Using the SRP to do VR reprojection based on depth map?

Discussion in 'Graphics Experimental Previews' started by hapliniste, Mar 27, 2018.

  1. hapliniste

    hapliniste

    Joined:
    Sep 8, 2013
    Posts:
    3
    Hello! I'm trying to do VR smooth locomotion without the player getting sick. For this, I want to render the world as a "screen cube" when the player move (so the 3D effect is not applied on the world).

    I did a couple images to help you understand the concept. Basically, the player should see the scene as if he was in a "CAVE" environment with only the left eye being shown.




    I tried to modify Oculus's single view repojection to make the effect, using CMD Buffers to store the left eye render and the depth pass of the "UI cube" but got a bit lost. It also doesn't seem to be the best approach for optimisation.

    I was wondering how you would use the new SRP to make this sort of rendering pipeline. When not moving, the rendering should be done normally (single pass or multipass, I don't mind), but when moving it should switch to this rendering loop, so only the left eye view get rendered, then we use it in combination with the UI depth map to reproject it to the right eye.

    How can we set different rendering loops for each eyes?

    The current approach I had (following Oculus's reprojection example) is using "if (ownerCam.stereoActiveEye == Camera.MonoOrStereoscopicEye.Right)" and overriding shaders when it was the right eye that was rendered but it seems dirty.

    Do we have example of VR rendering with the SRP? I would help me a lot! Thanks