1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

Water reflections in VR are wrong in 5.4.0F1

Discussion in '5.4 Beta Forum' started by Todd-Wasson, Jul 22, 2016.

  1. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,027
    Subject should read 5.4.0F2, not F1.

    Not sure if this is limited to VR or not, but reflections in water are completely wrong. Take a look at the green buoy. This is just one eye's shot. In the other eye the reflection is on the other side of the buoy. So in VR you get this weird looking reflection (not limited to the buoy, it's everything) all the way across the entire view that makes it look like the entire reflection is all on one plane a few meters ahead of the camera. Totally unusable.

    Is there something I can do to fix this? I'm using one of the stock water assets that comes with Unity.



    [​IMG]


    On an unreleated note, "single pass rendering" in VR doesn't work at all. It just shows two separate images from two separate viewpoints floating in front of you. Not bothering with a screenshot because anybody that's ever checked that box has got to know about it already.
     
    Last edited: Jul 22, 2016
  2. scottb

    scottb

    Unity Technologies

    Joined:
    Jan 26, 2016
    Posts:
    8
    Hi Todd, If you look at the C# file associated with the water you'll see that the reflection is only rendered once. However it needs to be rendered once per eye (twice in total) with the appropriate eye offset applied for this situation to work properly.
     
  3. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,027
    Thanks. I've had this on the market since last November and never had a problem until today when moving from 5.3.5p2 to 5.4.0f2. What changed is that now it's using OpenVR.

    Guess they still have some things to iron out yet. Bummer, I had hoped to do Tuesday's Steam release with Vive support but guess it'll have to remain Rift only for now.
     
  4. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,027
    I've reported it (Case 816992)

    I'm using a Rift here. Up until now on beta I was using only the OpenVR library. If I use only the Oculus library then the reflections are fine like they used to be. If I use both libraries (set in player settings under "VR supported"), it works correctly as long as I have the Oculus library defined before the OpenVR library. If I reverse the order the reflection problem comes back.

    I was under the impression that OpenVR handled both Vive and Rift. Is that not correct? To support both headsets in Unity do I need both libraries in there? The fact that the order of the libs in the list matters is a bit disconcerting. Would this mean Vive users would have the reflection problems if OpenVR is listed second?
     
  5. ScottF

    ScottF

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    62
    Todd, the reason the order matters is that Unity's implementation of Oculus (built in) vs the implementation of Oculus through OpenVR are very different. When the game starts it will go through the list of SDK's you have selected and use the first one which supports the HMD which is present. In this case the behavior when using OpenVR is different for water reflections, and almost certainly effects the Vive as well. We will investigate the case.
     
    Todd-Wasson likes this.
  6. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,027
    Thanks for the reply, Scott. Makes sense. I look forward to seeing it resolved.
     
  7. SeriousACZ

    SeriousACZ

    Joined:
    Jul 23, 2013
    Posts:
    19
    From what I've encountered with my derivative water reflection is that it only did one view for VR, even in 5.3. I hacked this by having two waters (one per eye), but this was extremely slow and problematic.

    I followed a blog post about using the Steam VR camera position and vr transformation matrix to capture two water renders, and then use the difference in the camera matrix to differentiate the eye view in a single output shader. This worked GREAT in 5.4.b11 on the DK2.

    Problem is now the Oculus headsets (CV1 and DK2) don't run at all on the OpenVR SDK, and in the Oculus SDK the Steam VR camera stuff doesn't seem to function meaning I have no pretty reflection.

    (In addition, since the upgrade my camera transforms are all weird too - it's like the camera is 2 meters above the head pivot. This is extra frustrating because the same camera rig worked great before. I have a feeling this is the Steam VR plugin failing when running with the Oculus SDK)
     
  8. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,027
    Camera positioning being too high is also there in OpenVR. I'm not using the SteamVR plugin. I suspect it's probably using the SteamVR software settings where you set up the head to floor height instead. I haven't figured out how to get around that yet and am not going to bother until the 5.4 beta is fixed up on the VR front.
     
  9. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,027
    5.4 released. Was this fixed up already or should I hold out for a later patch?