Lever rendering to Oculus Rift

screenshot

This is the first demo that runs on the Oculus Rift. It's in the samples/gl_boxdemo/ -directory

I wrote a vr -module to enable VR in any opengl program written in Lever. Here's a sample of how such module works:

import vr

hmd = vr.init()

hmd.begin()
if hmd.on
    for eye in hmd.eyes
        eye.bind()
        render(eye)
hmd.submit()
gl.viewport(width, height)
render(cam)

When inserted along the rest of the opengl application, this provides the full HMD support. The module itself is located in stdlib/vr.lc and it is clean to read.

There is only one issue I will solve when rifts start shipping: The vr -module is unable to get the texture size from the library, so it renders to every rift with a default resolution. It's a bug in the version of libffi that lever depends on.

The next month I will be working on features that should make lever easier to install and try.

Similar posts