informa
/
2 MIN READ
Blogs

Adding OculusVR support

I've just released (beta) support for the Oculus Rift in Leadwerks Game Engine. The implementation was much simpler than I expected, and isn't intrusive at all in our game structure.

Previously, I wrote about my experience trying Valve's VR room.  Since then, I graduated from my MBA program and moved up to Seattle to be closer to the PC gaming industry.  (Previously, I lived an hour away from Silicon Valley, but it's more mobile-centric there.)

I've just released (beta) support for the Oculus Rift in Leadwerks Game Engine.  I am targeting the latest OculusVR SDK and not SteamVR at this time, but I am definitely open to adding support for a range of hardware.  The implementation was much simpler than I expected, and isn't intrusive at all in our game structure.  To enable VR in any game, you just add the Window::VRDisplay flag in the creation flags in the Window::Create() function:

Window* window = Window::Create("My VR Game",0,0,1024,768,Window::Titlebar|Window::VRDisplay);

 

Or in Lua:

local window = Window:Create("My VR Game",0,0,1024,768,Window.Titlebar + Window.VRDisplay)

 

Head tracking and rotation are just automatic, and it works with pretty much any game.  Of course, you likely will want to adjust your control scheme for VR mode, as I find bad controls to be the biggest offender of nausea inducement.

I added the following commands for extra control over the simulation:

Vec3 VR::GetHeadRotation()

Use this to modify the way your controls work.  For example, use the player's head rotation to change the direction they move in when a key is pressed.  You do not need to rotate the camera yourself, as this is done automatically.

Vec3 VR::GetHeadPosition()

If you do any line of sight tests this would be useful.

void VR::Recenter()

Recenters the headset orientation according to the current position and rotation.

void VR::HideWarning()

Disable the Oculus warning popup, typically by pressing space or another key.
 

Overall, I found the Oculus Rift DK2 to be a big step up from the DK1, but the speed and tracking are still behind SteamVR.  With the DK2 I sometimes get that feeling of presence, but as soon as I start to get into it the illusion is often broken with bad tracking or lag.  I'm sure this will keep improving and I look forward to seeing what the final consumer hardware looks like.

Latest Jobs

Treyarch

Vancouver, BC, Canada
5.8.23
Producer

Bladework games

Remote (United States)
5.18.23
Senior Gameplay Engineer

University of Canterbury

Christchurch, Canterbury, New Zealand
5.17.23
Academic in Game Arts and Animation

Fred Rogers Productions

Hybrid (424 South 27th Street, Pittsburgh, PA, USA
5.19.23
Producer - Games & Websites
More Jobs   

CONNECT WITH US

Explore the
Advertise with
Follow us

Game Developer Job Board

Game Developer

@gamedevdotcom

Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Browse
Advertise with

Game Developer

Engage game professionals and drive sales using an array of Game Developer media solutions to meet your objectives.

Learn More
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more