Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VR Compatibility #9

Open
Knive opened this issue Feb 8, 2017 · 9 comments
Open

VR Compatibility #9

Knive opened this issue Feb 8, 2017 · 9 comments

Comments

@Knive
Copy link

Knive commented Feb 8, 2017

The lights are great but in VR (with an HTC Vive), they are somewhat shifted from the original position in both the right and the left eye but on different positions depending on the eye.

@SlightlyMad
Copy link
Owner

VR isn't supported. I don't have VR kit to test it and I don't plan to buy one. I'll accept pull request if somebody finds a way how to fix it and I'll update readme for now.

@Edgyy
Copy link

Edgyy commented Feb 20, 2017

Hi, just to provide some further insight, I attempted to use the Oculus SDK OVRCameraRig which allows you to choose either two separate cameras (one per eye) or a single one. Unfortunately, this didn't work properly with either.

When adding the Volumetric Light Renderer to each eye's camera separately, by default the volumetric lights appear only in the second camera (right eye) but not the first one (left eye). If you change the "depth" of the camera, the camera with the lowest depth shows the effect whilst the other one does not. Switching between deferred and forward rendering for both cameras also does not change the behaviour. One interesting point is that if you choose Single Pass Stereoscopic Rendering as opposed to the default Multi-Pass Stereoscopic Rendering, there are problems because the shader breaks the image (get a weird overlay and resolution is all wrong - it seems that a lot of effects, even standard Unity ones such as "Bloom" or "Sun Shafts" etc. also break) but it seems like the effect works for both cameras. So possibly there is a compatibility issue with the multi-pass rendering?

@SlightlyMad I would be willing to help with testing of new changes and contribute in any way. Thanks.

@chrisnobrega
Copy link

@SlightlyMad I'm also willing to help test any changes on the HTC Vive. That way we can cover both platforms.

@javl
Copy link

javl commented Apr 23, 2017

Pinging @Knive, @Edgyy and @chrisnobrega to check if any of you looked into this further. Maybe we can figure out what is going on together.

Trying the examples with the SteamVR plugin I can get the effect to work on one eye at a time only:

cam one target cam two target result left result right
left right no effect effect
right left effect no effect
left left no effect black
left off effect black
off left effect off
right right black no effect
off right black effect
right off black effect

I'm new to Unity and not quite sure about the way the two images for your different eyes get rendered. When I put a debug script line into the VolumetricLightRenderer script to check what camera it is drawing to, I get both. I was hoping it was somehow just drawing to one eye.

Debug.Log ("render to: ___" + _camera.stereoTargetEye +"___", _camera);
// Outputs: render to ___Both___

@kwnetzwelt
Copy link
Contributor

This is exactly the issue. Set the camera to only draw to one eye, and create a separate camera for the other eye, that will work fine!

@nights321
Copy link

nights321 commented Nov 25, 2017

Unity hangs when i have two Steam VR_Camera cameras in the SteamVR rig and press play

@kwnetzwelt
Copy link
Contributor

The issue here is the steam vr camera component. You should only have one of that.

@millenniummike
Copy link

millenniummike commented Jan 24, 2018

I got this working on Unity 2017.3.0f3
Opening example scene
Enabling PlayerSettings - XR Settings - Virtual Reality Supported
Duplicating Main Camera
Setting Camera 1 to left eye
Setting Camera 2 to right eye

Tried on HTC Vive and it looks pretty good.

The Directional light examples all worked but spotlight ones render to one eye hence the workaround above.

@ruonanzh
Copy link

For now, it works in Unity with Multpass on. I am using Unity 2017.4.8f1 and OpenVR. It is correct rendered on both eye if the light don't cast any shadow.

Wired thing about light casting shadow, it only show on the left eye. I am looking into this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants