Skip to main content
Inspiring
August 16, 2013

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 :)
    This topic has been closed for replies.

    25 replies

    Participant
    August 16, 2013
    Welldone Chaoss. I will try it now. It seems obvious from the images that it is wider.
    Up and Coming
    August 16, 2013
    Looks good, will have to test it out sometime.
    Current Project: Virtual Reality Glove project
    Up and Coming
    August 16, 2013
    I tested it... & its great.

    I'll use this in my Unity games... Thx
    http://www.mickbanks.com
    August 16, 2013
    Excellent! Will try this soon and update greebles soon with the new SDK + maybe this mod.
    Thanks!
    Inspiring
    August 16, 2013
    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.
    Titans of Space PLUS for Quest is now available on DrashVR.com
    ChaossAuthor
    Inspiring
    August 16, 2013
    "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.
    "In the future we will be designing dreams, worlds & experiences rather than games."
    Inspiring
    August 16, 2013
    "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.
    Titans of Space PLUS for Quest is now available on DrashVR.com
    ChaossAuthor
    Inspiring
    August 16, 2013
    "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 :)
    "In the future we will be designing dreams, worlds & experiences rather than games."
    ChaossAuthor
    Inspiring
    August 28, 2013
    Bump
    "In the future we will be designing dreams, worlds & experiences rather than games."
    Up and Coming
    August 29, 2013
    Agh... 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?
    My Old Projects QuantaCube DK2 Owner /u/diregoat on reddit