Forum Discussion
Chaoss
12 years agoExpert Protege
Chaoss's Unity 4 Pro SDK 0.2.4 FOV fix (black borders gone!)
So the new version of the Oculus Rift SDK has been released, head tracking feels much better and cleaner even when moving your head slowly... but wait! what is this?!

All that black wasted space! it hasn't been fixed! it might not look all that much in the picture, but I can see the black space at the edges as black bars either side of my view and annoys the hell out of me, it just doesn't feel right and it feels like I have blinders on.
Anyway after much tinkering around I've come up with a 'clean' fix. It did involve changing some values (the fov for example), but these values have NOT been manually hardcoded in. I've just simply 'added' to already existing values that get pulled from I don't know where so this should be compatible with future Rift hardware or none-standard setups.
I've done extensive testing in many different scenes and I can confirm that the scale, ipd and other settings are just as they were before and that there is no warping or other such issues.
This is how it looks now...

Much better and a much nicer field of view!
http://www.solidfiles.com/d/66ffd81af4/
Instructions are included in the .zip file :)

All that black wasted space! it hasn't been fixed! it might not look all that much in the picture, but I can see the black space at the edges as black bars either side of my view and annoys the hell out of me, it just doesn't feel right and it feels like I have blinders on.
Anyway after much tinkering around I've come up with a 'clean' fix. It did involve changing some values (the fov for example), but these values have NOT been manually hardcoded in. I've just simply 'added' to already existing values that get pulled from I don't know where so this should be compatible with future Rift hardware or none-standard setups.
I've done extensive testing in many different scenes and I can confirm that the scale, ipd and other settings are just as they were before and that there is no warping or other such issues.
This is how it looks now...

Much better and a much nicer field of view!
http://www.solidfiles.com/d/66ffd81af4/
Instructions are included in the .zip file :)
25 Replies
Replies have been turned off for this discussion
- metrowaveHonored GuestWelldone Chaoss. I will try it now. It seems obvious from the images that it is wider.
- CaliberMengskExplorerLooks good, will have to test it out sometime.
- MickmanProtegeI tested it... & its great.
I'll use this in my Unity games... Thx - AnonymousExcellent! Will try this soon and update greebles soon with the new SDK + maybe this mod.
Thanks! - drashHeroic ExplorerI don't think this quite works yet. Your change to a distortionscale multiplier (from 1 to 0.75) seems to be equivalent to when I previously tried having the return value of DistortionScale() be mulitplied by some number (in this case 1.333), and either way just blows up the final lens-corrected image to make better use of the display area. The problem is that the end result just looks like you're zoomed in and the FOV no longer feels right, and could be potentially nauseating.
Anyone else having any success with this?
On another (possibly related) note, I think Oculus was working on a way to be able to set the "CameraTextureScale" to something greater than 1.0 (like UDK's ScreenPercentage), but isn't quite there yet. There's a bit in OVRCamera.cs where CameraTextureScale is being set to the device's distortionscale, but this is commented out. If I uncomment it, I get a black screen (although maybe that's because I have more than one set of OVRCameraControllers).
IMO, the reason UDK and other engines are able to fill the whole screen with a lens corrected image is because they had a larger render buffer to begin with. It doesn't seem as though the Unity integration is quite there yet (although getting closer!).
Would love to hear from Oculus about their intentions with this. - ChaossExpert Protege
"drash" wrote:
I don't think this quite works yet. Your change to a distortionscale multiplier (from 1 to 0.75) seems to be equivalent to when I previously tried having the return value of DistortionScale() be mulitplied by some number (in this case 1.333), and either way just blows up the final lens-corrected image to make better use of the display area. The problem is that the end result just looks like you're zoomed in and the FOV no longer feels right, and could be potentially nauseating.
Anyone else having any success with this?
On another (possibly related) note, I think Oculus was working on a way to be able to set the "CameraTextureScale" to something greater than 1.0 (like UDK's ScreenPercentage), but isn't quite there yet. There's a bit in OVRCamera.cs where CameraTextureScale is being set to the device's distortionscale, but this is commented out. If I uncomment it, I get a black screen (although maybe that's because I have more than one set of OVRCameraControllers).
IMO, the reason UDK and other engines are able to fill the whole screen with a lens corrected image is because they had a larger render buffer to begin with. It doesn't seem as though the Unity integration is quite there yet (although getting closer!).
Would love to hear from Oculus about their intentions with this.
I have also altered the field of view (I've added a value to the value that gets called from the hardware or dll or wherever it gets those values from) to compensate so it no longer feels like your zoomed in, the in-game view is exactly the same except you now have a wider field of view and no black bars on either side. - drashHeroic Explorer
"Chaoss" wrote:
I have also altered the field of view (I've added a value to the value that gets called from the hardware or dll or wherever it gets those values from) to compensate so it no longer feels like your zoomed in, the in-game view is exactly the same except you now have a wider field of view and no black bars on either side.
I missed that -- I should have done a diff instead of eyeballing it. :) Gonna check this out. - ChaossExpert Protege
"drash" wrote:
"Chaoss" wrote:
I have also altered the field of view (I've added a value to the value that gets called from the hardware or dll or wherever it gets those values from) to compensate so it no longer feels like your zoomed in, the in-game view is exactly the same except you now have a wider field of view and no black bars on either side.
I missed that -- I should have done a diff instead of eyeballing it. :) Gonna check this out.
Try it out and let me know what you think :) - ChaossExpert ProtegeBump
- VirtualJesusHonored GuestAgh... this looks great and all, SOMEHOW i broke my game trying to put this script in. After an hour or so I'm giving up on how to fix it.. It happened when I tried to replace the OVRcameracontroller script. I tried reloading all the ovr scripts, etc, here's the error I'm getting:
Assets/OVR/Scripts/OVRCameraStripped.cs(42,39): error CS1061: Type `UnityEngine.RenderTexture' does not contain a definition for `antiAliasing' and no extension method `antiAliasing' of type `UnityEngine.RenderTexture' could be found (are you missing a using directive or an assembly reference?)
I'm not sure what this means. It's pointing to this line:
CameraTexture.antiAliasing = QualitySettings.antiAliasing;
any ideas?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 months ago
- 5 days ago
- 5 months ago
- 9 months ago
- 5 months ago