Control the world with the Skybox API

What if you could control the entire world around you with one simple line of Javascript? That would be amazing. Impossible, you say?

Well, not in VR with our virtual reality browser, Samsung Internet for Gear VR. With the latest version (4.2, update available now on the Oculus Store) we are introducing a new easy-to-use (experimental) API for customizing the background image or images that surround the user while they browse the web.

Behold:

window.SamsungChangeSky({ sphere: 'http://site.com/blue-sky.jpg' })

That’s it. This will change the 360° background image of the VR environment to whatever you choose to perfectly complement your webpage content, and delivering a more immersive experience.

Skybox API demo using stereo cubemaps

You’re not just limited to using a single 360° image either. There are a few different formats you can use to specify an image:

// equirectangular i.e. a sphere:
{ sphere: '360-photo.jpg' }
// mono skybox i.e. a cube:
{ front: 'f.png', back: 'r.png', left: 'l.png', right: 'r.png', up: 'u.png', down: 'd.png' }
// stereo cubemap skybox: provide for Left and Right eyes
{ Lfront: 'Lf.jpg', Lback: 'Lb.jpg', Lleft: 'Ll.jpg', Lright: 'Lr.jpg', Lup: 'Lu.jpg', Ldown: 'Ld.jpg',
Rfront: 'Rf.jpg', Rback: 'Rb.jpg', Rleft: 'Rl.jpg', Rright: 'Rr.jpg', Rup: 'Ru.jpg', Rdown: 'Rd.jpg' }

Note that you likely want to check if the API exists before calling it like so:

if ('SamsungChangeSky' in window) {
window.SamsungChangeSky({ sphere: 'outer-space.jpg' });
}

More details can be found here.

We look forward to seeing how you use it and welcome any feedback. Stay tuned for more additions to our experimental VR APIs, including a way to set backgrounds as your default environment.