cancel
Showing results for 
Search instead for 
Did you mean: 

Stereo Lens Flares in Unity 5.2.x w SDK 0.7

dsky9
Honored Guest
Hi, I had some lens flares I was using with Unity 5.0 / SDK 0.5...
I simply added a Flare Layer to each of the Eye cameras, and voila, I had stereo lens flares.

Now, There appears to be only one camera in the "OVRCameraRig" object, attached to "CenterEyeAnchor"
When I assign a Flare Layer to that, it renders monoscopically, which messes with the player's vision and contradicts the 3d visual signal.

I've tried copying the camera component from the CenterEye to the Left- and Right-eye objects, then manually assigning the Target Eye field on each of those, with a Flare Layer on each, but it appears that the Oculus codebase then de-activates my L adn R cameras at runtime, leaving the screen black.

Does anyone have lens flares working in stereo with SDK 07 + Unity 5.2.x, and if so,
can you please list steps to reproduce?

Thanks in advance,
3 REPLIES 3

dsky9
Honored Guest
Until I get better resolution on this, I'm using the "Sun" flare instead of the "50mm" lens flare. The sun flare is centered around the light source with simple radial beams, so even when rendered in mono, it doesn't give visual conflict that the 50mm does with its far flung rings and hexagons.

vrdaveb
Oculus Staff
This appears to be a limitation in the way Unity renders flares. We've reported it. For now, I'd recommend using two separate Cameras. Instead of putting Cameras on the left/rightEyeAnchors, you'll have to duplicate centerEyeAnchor and comment out the following lines in OVRCameraRig.cs. Then try setting the "Target Eye" on each one to "Left" or "Right" instead of "Both". Then you should be able to add a separate Flare Layer to each Camera and get correct results. Please let me know if that doesn't work.
					Debug.LogWarning("Having a Camera on " + cam.name + " is deprecated. Disabling the Camera. Please use the Camera on " + centerEyeCamera.name + " instead.");
cam.enabled = false;

dsky9
Honored Guest
@vrdaveb, Thanks so much for this. I'm on another project for a bit here, but I've copied the post and sample code and will plug it in and test it as soon as I have a little time available. Oh, here is the actual experience we're using it in:

http://dsky.co/solar/