Oculus Rift DK2
by Steve Lamperti · in Torque 3D Professional · 01/08/2015 (10:38 am) · 57 replies
I guess this post is a bit of an appeal for help. I work for a company that has a 3D window in our product that is based on T3D. We're always working on a new version, and when a customer said something about the Oculus Rift, I got excited, and told them that we might be able to support the rift in our next release, because I had seen information on this site about the engine supporting the rift.
I ordered the DK2, and was having a great time setting it up and playing with it, until I actually started trying to work with the code.
The DK2 interface is quite different then the DK1, and the current code in the engine is seriously out of date. The process of updating it is out of the scope of what I can do with the time I have available to work on it.
There is information on the OculusVR website about using T3D with the rift, and it's currently the case that anyone from there who tries will encounter the same problem.
After playing with the Rift for a while, it does seem like a powerful device, and it's sad if the T3D support is completely dropped.
I'm hoping that someone can update the code in the engine to support the DK2.
I ordered the DK2, and was having a great time setting it up and playing with it, until I actually started trying to work with the code.
The DK2 interface is quite different then the DK1, and the current code in the engine is seriously out of date. The process of updating it is out of the scope of what I can do with the time I have available to work on it.
There is information on the OculusVR website about using T3D with the rift, and it's currently the case that anyone from there who tries will encounter the same problem.
After playing with the Rift for a while, it does seem like a powerful device, and it's sad if the T3D support is completely dropped.
I'm hoping that someone can update the code in the engine to support the DK2.
#2
02/10/2015 (7:38 pm)
Is anyone currently working on adding support? I'm not quite sure if you're implying that progress is slow or that no progress is possible at this point.
#3
02/11/2015 (2:10 pm)
We're in negotiation with OR, thanks to Steve, to see if we can get a DK2 and who will receive it.
#4
02/18/2015 (9:38 am)
Thanks for the update, Daniel. Thanks for tackling the problem, Steve. I have a DK2 (and some development experience). Could I help out in any way, even with testing builds, etc? If nothing else, I want to say that there is at least one person out here hoping to see DK2 support!
#5
02/18/2015 (12:41 pm)
Hey guys, I'm working on it now. Expect to see some progress by the weekend. ;)
#6
02/18/2015 (1:48 pm)
Great news! Thanks for letting us know.
#7
02/18/2015 (2:34 pm)
@James... you are great!!! THX :)
#8
02/22/2015 (1:50 pm)
Just a little update, there's quite a few hefty API changes with the SDK so I'm having to refactor a fair bit of the existing code. Thankfully the rendering stuff still seems to work the same, its just the input code which is a pain. :(
#9
02/22/2015 (10:33 pm)
Interesting. It seemed that BeamNG got as far as deciding the opposite, that lots of rendering stuff needed to be changed. I never knew exactly what, though.
#10
02/25/2015 (3:30 pm)
@Daniel until I get something working, take everything I say with a pinch of salt. ;)
#11
I've fixed the head tracking to work with the new API. Seems to work correctly moving my headset around using the example.
Currently trying to hook up the rendering. There are a few approaches for this including letting the rift API do it for you, so I'll see whats best.
03/02/2015 (4:37 pm)
Jus a little update....I've fixed the head tracking to work with the new API. Seems to work correctly moving my headset around using the example.
Currently trying to hook up the rendering. There are a few approaches for this including letting the rift API do it for you, so I'll see whats best.
#12
03/03/2015 (2:39 pm)
:D
#13
I added positional tracking and skipped the barrelDistortionPostEffect, instead letting ovrHmd_EndFrame() apply distortion. Things were working OK (albeit with some "juddering" on the HMD, probably caused by a conflicting 60hz refresh rate from my primary monitor), but after updating to the 0.4.3 oculus runtime T3D would crash when calling device->Present(NULL, NULL, NULL, NULL); in CAPI_D3D9_DistortionRenderer.cpp. I had the same problem with the 0.4.4 sdk & runtime.
0.4.3 introduced latency improvements... something about using front-buffer rendering + timewarp to shave off a frame of latency. Likely culprit?
A few weeks later, Oculus announced they were dropping support for DirectX9. See here: https://forums.oculus.com/viewtopic.php?t=19489
I switched tracks by downloading and building the in-development DX11 and OpenGL forks of Torque3D. So far, my OpenGL project is looking promising. I'm handing the backBuffer texture to ovrHmd_EndFrame and it's rendering to the HMD, albeit without any of the distortion, vignetting, chromatic aberration correction, etc that the endFrame call is supposed to apply.
I've been learning this stuff as I go, but I'm eager to help.
03/04/2015 (7:47 pm)
I've been working on this. I decided to try to get the DK2 running in "direct" mode instead of the legacy "extended" mode, mainly because it sounded like the more future-proof way to go.I added positional tracking and skipped the barrelDistortionPostEffect, instead letting ovrHmd_EndFrame() apply distortion. Things were working OK (albeit with some "juddering" on the HMD, probably caused by a conflicting 60hz refresh rate from my primary monitor), but after updating to the 0.4.3 oculus runtime T3D would crash when calling device->Present(NULL, NULL, NULL, NULL); in CAPI_D3D9_DistortionRenderer.cpp. I had the same problem with the 0.4.4 sdk & runtime.
0.4.3 introduced latency improvements... something about using front-buffer rendering + timewarp to shave off a frame of latency. Likely culprit?
A few weeks later, Oculus announced they were dropping support for DirectX9. See here: https://forums.oculus.com/viewtopic.php?t=19489
I switched tracks by downloading and building the in-development DX11 and OpenGL forks of Torque3D. So far, my OpenGL project is looking promising. I'm handing the backBuffer texture to ovrHmd_EndFrame and it's rendering to the HMD, albeit without any of the distortion, vignetting, chromatic aberration correction, etc that the endFrame call is supposed to apply.
I've been learning this stuff as I go, but I'm eager to help.
#14
Great to see someone else also on the case! If it would help you I can plonk some of my code somewhere.
I'm having a little technical issue at the moment since in order to supply the correct projection matrices I need to refactor the frustum class to support the FOV changes with the latest SDK. I might just end up implementing an almighty hack at this point since this is dragging on a bit. ;)
03/07/2015 (4:03 pm)
@DanGreat to see someone else also on the case! If it would help you I can plonk some of my code somewhere.
I'm having a little technical issue at the moment since in order to supply the correct projection matrices I need to refactor the frustum class to support the FOV changes with the latest SDK. I might just end up implementing an almighty hack at this point since this is dragging on a bit. ;)
#15
03/08/2015 (2:29 pm)
Yay, more hacks :P. But yeah, do what you have to! Really keen to see this happening :)
#16
Hopefully should be able to "de-hackify" it later.
Currently aiming to have something I can actually look around in properly tomorrow.
03/08/2015 (5:23 pm)
@DanielHopefully should be able to "de-hackify" it later.
Currently aiming to have something I can actually look around in properly tomorrow.
#17
03/09/2015 (6:46 pm)
@James - I'd be greatful to run your code! I'm really just cargo-cult programming all this graphics stuff at this point, so it might help me learn something. I assume you're going the "extended mode" + client distortion route of the existing oculus module under DX9?
#18
At the moment I'm using extended mode since direct appears to be horribly broken in DX9. Since I'm using the oculus-provided distortion rendering however, the code is generic enough to work with OpenGL provided some wrapper code is written for it. Personally I'm hoping Daniel & co move to D3D11 for T3D 4.x... or at least have a reasonably stable OpenGL backend which would largely solve this problem ;)
Should be pushing some code later today provided I figure out whats going on with the projection matrix.
03/10/2015 (9:01 am)
@DanAt the moment I'm using extended mode since direct appears to be horribly broken in DX9. Since I'm using the oculus-provided distortion rendering however, the code is generic enough to work with OpenGL provided some wrapper code is written for it. Personally I'm hoping Daniel & co move to D3D11 for T3D 4.x... or at least have a reasonably stable OpenGL backend which would largely solve this problem ;)
Should be pushing some code later today provided I figure out whats going on with the projection matrix.
#19
Current pros:
- Head tracking works
- General rendering logic is there
Current major issues:
- Rendering is broken, so you won't see anything except some rather glitchy black frames in the window.
- Position (i.e. not rotation) is not tracked by the sensor code
- Needs some sort of mechanism to grab the latest rift tracking position when rendering as opposed to using the extrapolated position of the camera object
03/10/2015 (5:21 pm)
Rather than keep everyone in the dark I've pushed my current progress to https://github.com/jamesu/Torque3D/tree/or_dev - keep in mind at this stage it's not usable, so don't expect anything extraordinary at this stage.Current pros:
- Head tracking works
- General rendering logic is there
Current major issues:
- Rendering is broken, so you won't see anything except some rather glitchy black frames in the window.
- Position (i.e. not rotation) is not tracked by the sensor code
- Needs some sort of mechanism to grab the latest rift tracking position when rendering as opposed to using the extrapolated position of the camera object
#20
About OpenGL.... improve OpenGL support is a target of T3D 3.8.
I hope we can use OpenGL as "default renderer" soon.
03/11/2015 (7:57 am)
@James, thx for share code. I can't wait to test DK2 with Torque3D.About OpenGL.... improve OpenGL support is a target of T3D 3.8.
I hope we can use OpenGL as "default renderer" soon.
Timmy01