Forum Discussion
drash
13 years agoHeroic Explorer
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! :)
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! :)
4 Replies
Replies have been turned off for this discussion
- judah4Honored Guestdouble 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.
- drashHeroic Explorer
"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? - cyberealityGrand ChampionWell 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. - drashHeroic Explorer
"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!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device