Jump to content

Occulus Rift DK2 [ALSO: OpenVR]


MangoFusion

Recommended Posts

  • Replies 88
  • Created
  • Last Reply

Top Posters In This Topic

YO guys, an update in this general area...


I have rendering basically working with OpenVR, so should be able to wrap stuff into T3D fairly soon (minus controller support and more advanced stuff for the moment). Provided openvr has support for the latest oculus sdk, it should work with that fine.


I'm also looking to update to the latest oculus sdk but I cant currently give a timeframe on that.


Also apologies about not responding, I dont get notifications for this thread.

Link to comment
Share on other sites

  • 2 weeks later...

Very good news :)


So, is this in a compilable and working state? Ie. if I can get it compiled, will a person using a DK2 or a CV1 be able to use it in-game?


Also, what are the SDK requirements / Project setup settings to compile this build in Visual Studio 2010?


Thanks :)

Paul

Link to comment
Share on other sites

Yo paul,


While the code is compilable there is a problem with the display not working on the htc vive, though it works for the oculus. I'm having a little trouble atm with my hardware sporadically detecting the vive so I have not yet been able to resolve the issue.


To compile there are some cmake build options, or alternatively you can just include the platform/input/openvr files and manually add in the openvr sdk from https://github.com/ValveSoftware/openvr


Note that openvr only works with d3d11, it will not work with d3d9. So you need the d3d11 engine code and the relevant files for the game folder in order to be able to use it.

Link to comment
Share on other sites

OK, great, thanks!


So, just curious, how much has changed within the "game" folder to make it DX11 compliant? Because I have heavily modified many of the scripts and GUIs...


Also, do I need to use a different SDK path in my Visual Studio project, rather than the DirectX SDK June 2009 one that has been used for so long in the past T3D versions? Or is it just as simple as replacing my engine code with the DX11 engine code, and then merge in my custom engine changes, leaving the Visual Studio project pretty much the same?


Thanks again, looking forward to bringing my game up to date for DX11 and latest Oculus :)


Cheers

P

Link to comment
Share on other sites

The hard part with the dx11 roll in is that it happened at the same time as deferred shading roll in, so there are changes completely unrelated to dx11 going on. This will all be addressed properly(documentation) once 3.9 goes "live". Unfortunately at this stage the old dx sdk is required. I do have another branch that i'm working on now that has dx9 removed and is where i'll be putting other gfx related improvements in, stuff like dx11 speed improvements, new shadow filter, new texture formats and other things along those lines. I'll post a link when it's a bit more stable and ready, most of it will be found it 4.0 though.

Link to comment
Share on other sites

Having some trouble with this build...


I have my engine code all sorted out, the openvr files are in place and all the libs and includes are set up... All the proper files are in the project, the openVR seems to compile fine but all the OculusVr folder stuff is failing.


Looks like it is set for the 0.8 SDK, but yet it has code using ovrHMD which was deprecated in 0.8 in favour of ovrSession instead, according the to Oculus site:


https://developer.oculus.com/downloads/pc/0.8.0.0-beta/Oculus_Runtime_for_Windows/


So, I'm confused - how were you able to compile this,using the 0.8 SDK, or did you use an earlier one? And if you did, why is the source trying to call 0.8? I'm going in circles lol :)


Thanks

Link to comment
Share on other sites

Yeah when james was coding it all up, oculus guys decided to change the api again. Whoever is in charge of the dev sdk should be sacked. Anyway he has since turned his attention to OpenVR, will have to wait for him to comment and see if he has any plans to keep up with the oculus sdk.

Link to comment
Share on other sites

ahh yes I figured it must be something like that.


It's terrible how Oculus keeps moving the yard stick and not remaining backwards-compatible. Grr


Looks like I can get it to compile by just changing any instances of ovrHmd to ovrSession in the Torque code. It's running now.

Link to comment
Share on other sites

I was also wondering about some sort of pre-built sample project, for testing, mostly to have a copy of the game folder that would include any required mods to get the Oculus running... Is that possible to post somewhere?


In my older 3.7 T3D version, there were manual edits required to the scripts to enable the Rift DK1. I did those and the game runs great in my DK1. But I'm not sure if there are different script mods necessary for this new OpenVR code to work with a DK2 or a CV1 Rift?


I did manage get the engine code to compile properly last night, with the DX11 code and the Oculus 0.8 SDK + OpenVR SDK, as long as you make the required changes of "ovrHmd" to "ovrSession" in the platform/input/ovulusvr folder (if using the 0.8 SDK).


Now I just need to just merge in all my custom engine mods on top of that, which will be a pain since I am porting up from 3.7 so there are a lot of differences in the compare.


P

Link to comment
Share on other sites

I have thought about posting my custom engine mod to GitHub for those who want it, it includes tons of goodies merged in... However it uses the advanced character kit code which I am not sure I can include or not. We also use the Awesomium integration kit which is another commercial add-on.


So, that makes it tough to share my codebase. Too bad, because it is a great engine to start off with:


- latest DX11 T3D code

- AFX 2.0 included (thanks to Azaezel for that work)

- support for Oculus DK2/CV1 using OpenVR and Oculus SDK 0.8

- Advanced character kit modifications (many additional animations)

- Awesomium integration kit (use web-based interfaces in-game)

- Climbing resource (modified to work like the Action Adventure kit)

- Object selection using the mouse

- GUIs on objects

- Paul Dana's player-mountable turrets resource

- Rift enhancements for vehicles

- Dynamic agility for players (adjust player's speed/jump height dynamically)

- Melee (hand-to-hand) combat

- Jetpack enabled with hovering function (simulates weightlessness)


It's always a pain to port the code up to a new version because of all these mods I have to merge in, but this time it's worth it to gain DX11 and latest Oculus. I am hoping to finish up this weekend and have a test-ready binary to send out to anybody with a DK2 or CV1 that can tell me if it works :)

Link to comment
Share on other sites

Awesome! I'm happy to test your latest build as I have access to a DK2 (but not a Vive just yet). I also own all of the licensed content in your list with the exception of AFX which I've never had a need for!


*Edit* Have you by any chance played around with water volumes in your build ? They cause all kinds of render pain and suffering in the older Rift builds. If those issues are resolved in the latest DX11 stuff, it would save me a lot of trouble.

Link to comment
Share on other sites

Well, AFX has been open-sourced for a while now, so that's no issue :)


This will be all rolled into our free Star Trek 50th Anniversary game, so people with newer Rift devices can experience the ship in VR, which will be awesome. It works great on my DK1, so I imagine DK2 will be even sweeter.

Link to comment
Share on other sites

Time for another update...


I currently dont have plans to update the oculus code to the latest oculus sdk as I feel the OpenVR stuff fits the bill much better, while it also supports the oculus runtime. However if openvr & steamvr bomb or someone sends me the latest dev kit including all the controllers I may change my mind.


So unless anything changes or someone else picks it up, assume the existing oculus code to be deprecated.


I've currently fixed the rendering problem with the vive runtime so i'll be incorporating that fix into the code tomorrow. Provided there are no more major problems with the rendering i'll then sort out the next stage: controller support.

Link to comment
Share on other sites

Been trying to get the DX11 to work, but am having some issues...


I have built a new EXE using the DX11/OpenVR build, and the executable runs fine in the sample Template as long as the Video option is set to DX9. But when I set to DX11 in the video options and then restart the game, it crashes on the splash screen. Console does not report anything specific, other than it seems to crash during or right after loading the lighting system.


Is there anything specific I need to do when building this, to enable the DX11? because in the console.log it seems to be detecting the DX11 device right away no problem, identifies my video card and says it is capable, that's encouraging, but then it says there is no card profile for dx11 in the core directory. Is this a file that needs to be there but is not in the distribution for some reason?


Anyhow, just wondering if there is anything I may have missed?


My codebase has AFX merged in, which could be part of the problem, and it's also possible I missed something in my code merge. But I have looked over the compare several times and I'm pretty sure I got everything done properly.


I can't find any guide or documentation anywhere that tells how to build and deploy for DX11, it's kind of a mystery, so any help would be appreciated.


Thanks!

Link to comment
Share on other sites

Ok guys i've updated the branch with my latest code. Based on my testing head tracking appears to work correctly. Located as usual here:

https://github.com/jamesu/Torque3D/tree/dx11_openvr


In order for it to work, TORQUE_EXTENDED_MOVE needs to be set as well as the openvr code needs to be included - for cmake this is handled by the module_openvr.cmake which adds in TORQUE_OPENVR & TORQUE_OPENVR_SDK_PATH. Alternatively you can add the files and required libs manually, just include everything in openvr headers and lib/win32 (or win64 if compiling for 64bit). Also dont forget platform/input/openvr on the torque end.


I've also uploaded an example game folder here which should have the openvr stuff setup provided you use the d3d11 display adapter (i.e. $pref::Video::displayDevice needs to be D3D11 and you need to have compiled in the d3d11 code): https://drive.google.com/file/d/0B9SPZhVNDK6BM3F1Z3JLTDdTY3M/view?usp=sharing


Going to work on the overlays next. While there is already some overlay code present (mainly used for the metrics and dialog boxes) its currently not making any use of the openvr overlay API.


Theres also still some odd things going on with the rendering which im looking into - might just be something using the wrong rendering target though i'm not sure.


After that.... controller support.


@PaulWeston


I've just been using the project file generated by the cmake build system with "TORQUE_D3D11" set to true. I suggest checking out the game code I linked and seeing if there are any missing bits of code.

Link to comment
Share on other sites

OK thanks...


And just to confirm, you use which Oculus SDK to compile this with?


Because I tried using the 0.8 (that's what the source code in platform/input/oculusvr calls for), however it will not compile without changing the source code to use "ovrSession" instead of "ovrHmd".


If I change those, it compiles fine using 0.8, the game runs fine in normal dx9, however with dx11 set it crashes immediately after the splash screen.


So, I thought I would try using the older SDK 0.5, which used to work, but it does not compile without requiring other source changes.


I'm just running in circles and can't figure out how you guys are making this work while I can't, lol.


I know I'm close.

Link to comment
Share on other sites

The branch linked is just setup for openvr, not the oculus SDK (i.e. you only need to use the openvr sdk for this). Its possible to use oculus headsets with openvr provided you have the correct plugin installed - you just need steamvr installed and a recent oculus runtime installed. (see https://support.steampowered.com/kb_article.php?ref=3180-UPHK-0900 for more details).


Dont worry, this stuff is still experimental - experience is bound to be rough. ;(

Link to comment
Share on other sites

Ahhh, so just remove the /oculusvr folder from the project and recompile, it's no longer needed?


So if I don't have steamVR an oculus runtimes installed, that might explain why it crashes for me?


I only have the old Rift DK1, which never needs a driver or a runtime, it's just a display and worked great that way. So I already have a working EXE that can be used for that, but people tell me it didn't work in their DK2...


Will this new EXE that I make using your code be usable by them? In theory at least? lol


And can I just install steamVR and an oculus runtime and simulate this somehow on my system, just to make sure it runs?


Thanks again, cheers

Link to comment
Share on other sites

Here is the difference between DX9 and DX11 for me, any ideas why DX11 crashes?


Thanks :)


DX11:


core/scripts/client/oculusVR.cs (135): Unable to find function getOVRHMDDisplayDeviceId

Attempting to create GFX device: AMD Radeon HD 6670 (D3D11) []

Device created, setting adapter and enumerating modes

Hardware occlusion query detected: Yes

WMIVideoInfo: DxDiag initialized

Initializing GFXCardProfiler (Direct3D11)

o Chipset : 'AMD'

o Card : 'AMD Radeon HD 6670'

o Version : ''

o VRAM : 2032 MB

- Scanning card capabilities...

GFXCardProfiler (Direct3D11) - Setting capability 'maxTextureWidth' to 16384.

GFXCardProfiler (Direct3D11) - Setting capability 'maxTextureHeight' to 16384.

GFXCardProfiler (Direct3D11) - Setting capability 'maxTextureSize' to 16384.

- Loading card profiles...

- No card profile core/profile/Direct3D11.cs exists

- No card profile core/profile/Direct3D11.AMD.cs exists

- No card profile core/profile/Direct3D11.AMD.AMDRadeonHD6670.cs exists

- No card profile core/profile/Direct3D11.AMD.AMDRadeonHD6670..cs exists

core/scripts/client/openVR.cs (231): Unable to find function getOVRHMDResolution

GuiCanvas::setVideoMode(): Error - Invalid resolution of (800, 600) - attempting (800, 600)

core/scripts/client/postFx/ovrBarrelDistortion.cs (82): Unable to instantiate non-conobject class BarrelDistortionPostEffect.

core/scripts/client/postFx/ovrBarrelDistortion.cs (108): Unable to instantiate non-conobject class BarrelDistortionPostEffect.

core/scripts/client/postFx/ovrBarrelDistortion.cs (133): Unable to instantiate non-conobject class BarrelDistortionPostEffect.

% - PostFX Manager - Executing core/scripts/client/postFx/default.postfxpreset.cs

% - PostFX Manager - Applying from preset

% - PostFX Manager - PostFX enabled

core/scripts/gui/messageBoxes/messageBox.ed.cs (23): string always evaluates to 0.

Missing file: core/art/gui/customProfiles.cs!

LOADING CLIENT SCRIPTS---------------------------------------------------

LOADING SERVER SCRIPTS---------------------------------------------------

sfxStartup...

SFXSystem::createDevice - created DirectSound device 'Primary Sound Driver'

SFXDSDevice::setDistanceModel - 'linear' distance attenuation not supported by DirectSound

Provider: DirectSound

Device: Primary Sound Driver

Hardware: No


******* GAME CRASHES HERE, NOTHING MORE IN CONSOLE.LOG ******



DX9 is fine:


core/scripts/client/oculusVR.cs (135): Unable to find function getOVRHMDDisplayDeviceId

Attempting to create GFX device: AMD Radeon HD 6670 (D3D9) [\\.\DISPLAY1]

GFXD3D9EnumTranslate: Unassigned value in GFXD3D9PrimType: 5

Device created, setting adapter and enumerating modes

Cur. D3DDevice ref count=1

Pix version detected: 3.000000

Vert version detected: 3.000000

Maximum number of simultaneous samplers: 16

Number of simultaneous render targets: 4

Hardware occlusion query detected: Yes

Using Direct3D9Ex: No

WMIVideoInfo: DxDiag initialized

Initializing GFXCardProfiler (D3D9)

o Chipset : 'AMD'

o Card : 'AMD Radeon HD 6670'

o Version : ''

o VRAM : 2032 MB

- Scanning card capabilities...

GFXCardProfiler (D3D9) - Setting capability 'autoMipMapLevel' to 1.

GFXCardProfiler (D3D9) - Setting capability 'maxTextureWidth' to 16384.

GFXCardProfiler (D3D9) - Setting capability 'maxTextureHeight' to 16384.

GFXCardProfiler (D3D9) - Setting capability 'maxTextureSize' to 16384.

GFXCardProfiler (D3D9) - Setting capability 'lerpDetailBlend' to 1.

GFXCardProfiler (D3D9) - Setting capability 'fourStageDetailBlend' to 1.

GFXCardProfiler (D3D9) - Setting capability 'independentMrtBitDepth' to 1.

- Loading card profiles...

- Loaded card profile core/profile/D3D9.cs

- No card profile core/profile/D3D9.AMD.cs exists

- No card profile core/profile/D3D9.AMD.AMDRadeonHD6670.cs exists

- No card profile core/profile/D3D9.AMD.AMDRadeonHD6670..cs exists

core/scripts/client/openVR.cs (231): Unable to find function getOVRHMDResolution

GuiCanvas::setVideoMode(): Error - Invalid resolution of (800, 600) - attempting (800, 600)

GFXPCD3D9Device::reset - depthstencil 752c238 has 2 ref's

--- Resetting D3D Device ---

GFXPCD3D9Device::reset - depthstencil 75d1c58 has 2 ref's

--- Resetting D3D Device ---

core/scripts/client/postFx/ovrBarrelDistortion.cs (82): Unable to instantiate non-conobject class BarrelDistortionPostEffect.

core/scripts/client/postFx/ovrBarrelDistortion.cs (108): Unable to instantiate non-conobject class BarrelDistortionPostEffect.

core/scripts/client/postFx/ovrBarrelDistortion.cs (133): Unable to instantiate non-conobject class BarrelDistortionPostEffect.

% - PostFX Manager - Executing core/scripts/client/postFx/default.postfxpreset.cs

% - PostFX Manager - Applying from preset

% - PostFX Manager - PostFX enabled

core/scripts/gui/messageBoxes/messageBox.ed.cs (23): string always evaluates to 0.

Missing file: core/art/gui/customProfiles.cs!

LOADING CLIENT SCRIPTS---------------------------------------------------

LOADING SERVER SCRIPTS---------------------------------------------------

sfxStartup...

SFXSystem::createDevice - created DirectSound device 'Primary Sound Driver'

SFXDSDevice::setDistanceModel - 'linear' distance attenuation not supported by DirectSound

Provider: DirectSound

Device: Primary Sound Driver

Hardware: No

Buffers: 16

--------------

Attempting to set resolution to "800 600 false 32 4 4"

Accepted Mode:

--Resolution : 800 600

--Full Screen : No

--Bits Per Pixel : 32

--Refresh Rate : 4

--FSAA Level : 4

--------------

GFXPCD3D9Device::reset - depthstencil 75b81f8 has 2 ref's

--- Resetting D3D Device ---

GFXPCD3D9Device::reset - depthstencil 755e338 has 2 ref's

--- Resetting D3D Device ---

Link to comment
Share on other sites

Do you have a stack trace of your crash? Tends to be more useful than the console log since that doesn't give any indication as to why it crashed (usually). Otherwise I havent a clue. :(


If you grab the openvr sdk from https://github.com/ValveSoftware/openvr there is a demo project in the samples folder, "hellovr_opengl". If you can build and run that AND if it recognises your DK1, chances are it will work in T3D with my changes too (assuming you can get your stuff working with d3d11). You'll need a recent oculus runtime and possibly steamvr installed for that though, and given i've never used a DK1 I have no idea if that works with the current oculus runtime.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   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...