Skip to main content
Inspiring
April 18, 2013

Getting Sunshafts to work properly with OVRCamera

I started playing with the SunShafts image effect in Unity (for this demo: https://developer.oculusvr.com/forums/viewtopic.php?f=42&t=490), and I realized I'm not sure how it's supposed to work with OVRCamera.

First of all, I am aware of the other "Image Effects" thread (https://developer.oculusvr.com/forums/viewtopic.php?f=37&t=102) and that there is talk about image effects not working (and getting a black screen), and the code fix suggested there does help.

However, after doing that and adding the SunShafts image effect to my standard non-Rift camera, increase the intensity to 3, this is what I get (and this is what I want):


I then added SunShafts components to each of the OVRCameras (CameraLeft and CameraRight in the OVRCameraController prefab), and set both of their intensities to 3. This is what I get in Rift mode:


At first I thought, wow maybe somehow the effects are being combined, so I turned off one of the SunShaft effects only to confirm that that simply turns off the effect for one eye. I then turned it back on and tried to dial down the intensity on one of the SunShaft effects but something is still way off:


Does anyone have an explanation or suggestion?
Thanks in advance! :)
    This topic has been closed for replies.

    4 replies

    Up and Coming
    April 18, 2013
    double check all parameters are the same which by what you say they should be. Other than that, make sure the order of the components has the sunshaft script before the OVRCamera and OVRLensCorrection script. Other than that, I an not very sure what could be happening other than high blur iterations.
    drashAuthor
    Inspiring
    April 18, 2013
    "judah4" wrote:
    double check all parameters are the same which by what you say they should be. Other than that, make sure the order of the components has the sunshaft script before the OVRCamera and OVRLensCorrection script. Other than that, I an not very sure what could be happening other than high blur iterations.


    Thanks for the response! Yep the parameters are all the same. In my case this meant just dropping in the SunShafts component onto a camera gameobject and change intensity to 3. I did try moving the SunShafts components up such that they were listed before the OVRLensCorrection components but this had no effect on the result.

    Weird. Anyone else have an issue with this?
    Titans of Space PLUS for Quest is now available on DrashVR.com
    Inspiring
    April 18, 2013
    Well it's possible that something with the OVRCamera is not compatible with that particular effect (for example, the custom projection matrix). I did just test it with the Tuscany level (adding sun-shafts to both cameras and setting intensity to 3), and I got the same blown-out image as you posted.

    However, even when testing with a standard 2D camera, the sun-shafts at 3 seem to display the same problem (large blown-out white areas). So I am not entirely sure if its a problem with our code or maybe just a side-effect of how the sun-shaft shader works. I think especially with the high FOV it may make the problem more apparent.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    drashAuthor
    Inspiring
    April 19, 2013
    "cybereality" wrote:
    Well it's possible that something with the OVRCamera is not compatible with that particular effect (for example, the custom projection matrix). I did just test it with the Tuscany level (adding sun-shafts to both cameras and setting intensity to 3), and I got the same blown-out image as you posted.

    However, even when testing with a standard 2D camera, the sun-shafts at 3 seem to display the same problem (large blown-out white areas). So I am not entirely sure if its a problem with our code or maybe just a side-effect of how the sun-shaft shader works. I think especially with the high FOV it may make the problem more apparent.


    Aha! That's an interesting point about the FOV. That's probably the fundamental piece I'm missing here. Out of town for now but I have stuff to try when I get back. Thank you!
    Titans of Space PLUS for Quest is now available on DrashVR.com