Occulus Rift DK2 [ALSO: OpenVR]

Materials, textures, lighting, postfx
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7
  • 9
89 posts Page 5 of 9
PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
by PaulWeston » Thu Apr 28, 2016 9:05 pm
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.
Hebblewhite
Posts: 18
Joined: Fri Mar 13, 2015 11:42 pm
by Hebblewhite » Thu Apr 28, 2016 9:13 pm
OK cool. I'll keep an eye open for updates then!
MangoFusion
Posts: 50
Joined: Wed Feb 04, 2015 12:00 am
by MangoFusion » Sat Apr 30, 2016 2:44 am
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.
PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
by PaulWeston » Sat Apr 30, 2016 4:13 pm
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!
MangoFusion
Posts: 50
Joined: Wed Feb 04, 2015 12:00 am
by MangoFusion » Sun May 01, 2016 1:55 am
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/0B9SPZh ... sp=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.

@
User avatar
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.
PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
by PaulWeston » Sun May 01, 2016 3:34 am
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.
MangoFusion
Posts: 50
Joined: Wed Feb 04, 2015 12:00 am
by MangoFusion » Sun May 01, 2016 3:47 am
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_art ... -UPHK-0900 for more details).

Dont worry, this stuff is still experimental - experience is bound to be rough. ;(
PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
by PaulWeston » Sun May 01, 2016 3:55 am
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
PaulWeston
Posts: 143
Joined: Thu Apr 23, 2015 7:16 pm
by PaulWeston » Sun May 01, 2016 4:06 am
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 ---
MangoFusion
Posts: 50
Joined: Wed Feb 04, 2015 12:00 am
by MangoFusion » Sun May 01, 2016 10:54 am
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.
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7
  • 9
89 posts Page 5 of 9

Who is online

Users browsing this forum: No registered users and 1 guest