Jump to content
  • entries
    943
  • comments
    5,899
  • views
    923,761

Initial VR Implementation


Josh

4,005 views

 Share

As you probably noticed, I've been playing around with the Oculus Rift DK2 and it's really neat! With Klepto's help I was able to get it running and integrated into the engine very quickly. Beta support will be added soon so you can play with it yourself. Why is it beta? Because it is possible some behavior may change, particularly the way head rotation is handled. Also, it only works on Windows at this point. I'm waiting for OculusVR to add direct HMD rendering for Linux, because without that it's not a very pleasant experience.

 

blogentry-1-0-04340800-1415839766_thumb.jpg

 

The renderer has been modified so that directional lights are only re-rendered once per frame, instead of re-rendering directional shadows once for each eye. The speed of the Leadwerks renderer also helps here. I noticed my VR apps feel noticeably smoother than most demos I have tried. Leadwerks by default uses direct HMD rendering with display mirroring turned off, so it's the fastest possible mode the rift allows. This is important because latency = nausea, and I and others can be affected pretty strongly with simulator sickness.

 

Enabling VR in your game could not be easier. Just use the Window::VRDisplay creation flag when you create your game's window, and you're done. Really, that's all it takes:

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)

 

You can also call VR::GetHeadRotation() and VR::GetHeadPosition() to track the player's current orientation. Camera rotation and translation are handled for you automatically, though, so this is really only needed for adjusting your direction of movement and things like that.

 

This will be available soon on the beta branch on Steam.

  • Upvote 8
 Share

5 Comments


Recommended Comments

Been hearing alot about people getting sick due to the disconnect from your eyes telling you that you are moving but your *** telling you your not - are you seeing this effect?

 

Seeing as apparently the problem apparently goes away if you got have a fixed frame in image ( like a cockpit ) I was wondering if perhaps a hud would also make the problem go away.

 

I've no interest in the device if it's just an advanced vomit inducer in regards to FPS games ;)

Link to comment

To a degree, I do experience this, yes. Not getting sick, but rather a little dizzy and "headachy". I normally don't get seasick and can easily read in a car. Apparently, you need a few days or even weeks to train your brain for this new experience, but I haven't gotten that far.

 

A normal HUD wouldn't help, I guess. And it flies a little in the face of the immersive experience, since it doesn't move when turning your head. The normal recommendation is to have a 3D user interface in front of the player. These things are probably one of the trickiest issues in VR: You have to come up with different interaction schemes tailored to the new experience.

Link to comment

i have the DK 2 for quite some time. And when playing FPS games i get sick really quickly. a HUD does not help here as far as i could notice, but then most games i tested had not much hud on screen.

 

I think the only way to get it away is really having some object that your brain "knows" is driving you instead of walking on your own.

 

So far i tried FPS multiple times to see if i got more accustomed to FPS games but so far i still get sick quickly. But because i get sick in FPS games i don't play FPS games so much. (its just uncomfortable to have the feeling you need to puke every moment you know. ;) )

 

So far the worst experience was the kontiki demo.

 

What seems to help is having some freedom for your mouse so your virtual body only rotates when your mouse hits the corner.

Also rotating quickly. (for example rorating in a couple degree steps when pressing Q or E) But still the best way is to have your virtual *** sit in a vehicle.

 

( virtual wheelchair simulator anyone? :) )

Link to comment

One thing I tried was adding a large cross-hair like image onscreen when the mouse moves. This gives the player a fixed point of reference and helped reduce the problems I had with it.

 

With VSync enabled and max framerate it does pretty well though. I was playing some other demos that had choppy performance and bad tracking, and they were pretty painful.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...