I originally wrote this post in late November 2015, but decided not to publish it because I felt like it was a temporary kludge. Then, in early May 2016, I saw this: “Microsoft Adds Peripheral Vision to VR” … turns out someone at Microsoft was thinking along similar lines. As a result, I thought I’d publish it with minor changes since it may be of interest after all. The Cardboard SDK has changed a bit since then, I don’t know if the code snippets still work on the latest version. Plus, I presume Cardboard will be retired in favor of “Daydream” in Android VR devices.

When you look at a screenshot of a typical VR head mounted display, you’ll notice there’s quite a bit of black space around the outside. This “non-viewable area” comes about due to the nature of the optics in the current generation of VR headsets. If the optics are set up correctly, these black borders shouldn’t really be visible. But maybe there’s an efficient way to put this wasted screen space to good use ?

bubizubi on Reddit made this great DIY hardware hack by aiming to reduce the effect of the limited field of view (FOV) in Google Cardboard. By making the wall holding the lenses semi-transparent and lining the interior of the headset with reflective foil, the overall colour of the scene can find it’s way to your peripheral vision. Inspired by this, I decided to see if I could go one step further and use the (normally) non-viewable area to enhance a VR experience. The idea is simple – rather than making the non-viewable area black, why not make it another solid colour that will be perceptible in the viewers mid- or far-peripheral vision ? This will have no impact on the time to render a frame – but it might help reduce the “tunnel vision” effect of a limited FOV when used with suitably modified hardware.

View post on imgur.com


It’s worth noting – this technique probably doesn’t add anything unless you have a viewer with bubizubi’s modifications that make the whole screen visible – with my unmodified Cardboard v1 the peripheral edges aren’t visible at all so their colour makes no difference. I’m yet to receive my Wearality Sky headset, but I’m keen to see what implications of using this technique might be when you have a 150 degree FOV, especially if you choose to render only ~120 degrees of it and use flat colour for the additional 30 degrees that fall into the far-peripheral vision. This might be a reasonable trade-off to allow current mobile devices to cope with the heavier rendering that comes with a wide field of view.

Here are the modifications I made to the Cardboard SDK for Unity, with modified or added lines highlighted.

In CardboardPostRender.cs, we make the border colour a configurable variable like so:

In CardboardPreRender.cs, we need to ensure that the new background colour is applied when the buffer is cleared, prior to rendering the content:

And, inside the main Cardboard.cs singleton, we add our edge colour variable:

You can then modify Cardboard.SDK.EdgeColor as you see fit. Lightning  strikes in your scene ? Flash it white. Player takes damage ? Try flashing it red. Bright white room ? Set it to white.

A screenshot example, before and after (using green to match the scene):


This technique could also be extended to use a low resolution RenderTexture of a camera with wide field of view to provide more than just a uniform flat colour (eg, so an object coming from one side might be sensed in the far periphery).

In a way, this is like a very low tech precursor to foveated rendering – there’s no need to render high detail in the peripheral vision, but matching the overall colour in the periphery to the rest of the scene might add to the immersion.