Water reflections in VR are wrong in 5.4.0F1

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.

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.

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.

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.

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?

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.

1 Like

Thanks for the reply, Scott. Makes sense. I look forward to seeing it resolved.

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)

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.

5.4 released. Was this fixed up already or should I hold out for a later patch?