Virtual reality glasses on Linux

Developing for the Rift

If you want to develop software for the Rift, the related manual contains all the information you need about the included SDK. The Oculus Rift in Action book [11] by Bradley Austin Davis, Karen Bryla, and Alex Benton is described by the authors as a work in progress. It deals with programming for the Rift, and it points users to a GitHub repository with freely available examples for application developers [12]. Listing 2 shows how the software, which integrates a customized version of the Oculus Rift SDK, can be built on Ubuntu 14.04.

Listing 2

Oculus SDK for Linux


After installing some header files in the first step, you download the code from the GitHub repository and retrieve the init and update submodules. You then create a build directory, change into this, then run cmake to generate a Unix-style Makefile, which you then run as the last step.

If the compile process fails, you may need to go back and add more development packages, according to the error messages. If the process is successful, the executable sample files end up in the build/output directory.

Motor Controlled

You can quickly accumulate a huge amount of code in 3D programming; thus, it makes sense  – and not only for game developers  – to use 3D graphical editors that rely on an underlying game engine. The Unity engine is very popular and well supported in this respect. Oculus VR includes files that help Unity output Rift-optimized demos; the SDK also exports files for Linux.

On the website, you will also find a manual for Unity integration [13] and a Unity variant of the Toscana demo [9]. The downside: The Unity editor needs to be installed, and it still doesn't run natively on Linux. Additionally, the graphics in games created with Unity are not generally considered state-of-the-art  – even if they are perfectly okay for many of today's indie games.

Less well integrated, but just as interesting, is Valve's Source SDK 2013, which supports the Oculus Rift [14]. Developers of commercial games need a commercial license; for all others, the engine is free to use. It is installed on your disk along with the fairly ancient Hammer editor.

For something more visually state-of-the-art, try the Unreal engine and CryENGINE. The manufacturers of both announced Linux versions for spring 2014, and the pricing model was changed. Versions 3 and 4 of the Unreal engine support the Rift, and CryENGINE has built-in Rift support (versions 3 and 4).

Among the free engines, Torque 3D [15] works with the Oculus Rift, and Panda3D [16] offers at least rudimentary support. The Blender Game Engine (BGE) also works with the VR glasses; developer Lubosz Sarnecki created a Python wrapper [17] based on the OpenHMD library and released under the Boost Software License.

Web 3.0

On the web, many projects and people focus on data glasses. Some simply render an existing image stereoscopically and show it at a certain distance; this also works for YouTube videos. The difficult part is integrating head tracking; usually the user can only change perspective with the mouse or keyboard. The vr.js [18] library also supports head tracking, but it relies on the outdated NPAPI.

In particular, the JavaScript Three.js [19] library is very popular in the 3D community. Several impressive projects are hosted on the associated website, including a demo for the Rift [20]. Last, but not least, Second Life could be making a comeback thanks to the new technology: At least, the alternative CtrlAltStudio client [21] supports the VR glasses.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Firefox Steps into 3D

    New initiative will bring futuristic virtual reality effects to the web surfing experience.


    Long lines and interesting discussions awaited the visitor at this year's FOSDEM event in Brussels, Belgium.

  • News

    Updates on technologies, trends, and tools.

  • Welcome

    The world is left to wonder if the recent news of a Debian fork is an important event or a minor historical footnote. Either way, it seems like a good story, reminiscent of the Linux stories of the past, when the community really looked and behaved like a collection of individuals rather than a corporate fan club.

  • The Eyes Have It
comments powered by Disqus