ValveSoftware / unity-xr-plugin

OpenVR plugin for Unity's XR API
BSD 3-Clause "New" or "Revised" License
309 stars 64 forks source link

Scene lights get cut off in left/right eye when post processing enabled #36

Open montoulieu opened 4 years ago

montoulieu commented 4 years ago

Hey there, I've been running into an issue with lighting and have been trying to narrow down what's causing it.

With all of my lights I've noticed that at certain distances they will start cutting off parts in either the left or right eye depending on what orientation the player is looking at them.

I was able to reproduce the issue in a new project with steamVR, the unity-xr-plugin, multi-pass rendering and post processing enabled.

Here is a video example from the right eye perspective, but this affects both eyes causing a weird flickering issue: https://imgur.com/a/0oAVIH4

I'm not certain if this is a Post Processing package issue or with the xr plugin, but was hoping someone could help point me in the right direction.

Thanks!

1runeberg commented 4 years ago

HI @montoulieu - this looks like a culling issue. Can you provide repro steps on a new project? ASlso, do you mean that the issue also exists with our SteamVR Plugin (Pre-Unity XR archi)?

montoulieu commented 4 years ago

Hey @1runeberg, thanks for getting back to me on this, and no I just meant the SteamVR plugin with the current Unity XR architecture.

Here are some repro steps I tried today using Unity 3D 2020.1.9:

  1. Create a new Unity 3D 2020.1.9 project using the standard render pipeline
  2. Install SteamVR Unity Plugin v2.6.1 with OpenVR XR plugin
  3. Go to XR plugin Management and enable OpenVR Loader
  4. Click on OpenVR tab and set to multi pass rendering
  5. Generate and save SteamVR Input Action Set
  6. Install Post Processing 2.3.0 from Unity Registry in Package Manager
  7. Delete default directional light and main camera in scene
  8. Drag CameraRig prefab from Assets/SteamVR/Prefabs into scene and set Position to (0,0,0)
  9. Select child Camera gameobject and add Post-process Volume and Post-process Layer
  10. On Post-process volume, set Is Global to true and create a new post process profile
  11. On Post-process layer, set Layer to Everything
  12. Create a 3D plane at position (0,0,0) and set it's scale to (10,10,10)
  13. Create a point light and set it's position to (0,1,40)
  14. Play the scene and look towards the point light. You should see that the light will cull differently between your eyes if you turn your head to left and right.
  15. Toggle the Post-process Layer on the camera and you'll see it gets rid of the culling issue all together.

I'm on a Valve Index using the latest SteamVR beta.

Hope that helps, let me know if I can assist with anything else!