Jump to content

OpenVR 1.0.17 Update


OTHGMars

Recommended Posts

There is a branch that updates T3D to build with the latest OpenVR release and adds support for the new IVRInput Interface and Hand Skeletons.

The branch is here: https://github.com/OTHGMars/Torque3D/tree/OVR_1017f

 

Build instructions and branch notes are here: https://github.com/OTHGMars/Torque3D/blob/OVR_1017f/Templates/Modules/ovrModule/branchNotes.md

All of the scripts used when creating the videos below are included.

 

 

 

 

 

 

Link to comment
Share on other sites

  • 5 months later...

It's great.

With friends we want to do a VR game, we would like to use T3D.

So I have a few questions about T3D and VR.

1) the VR extension is shown with an oculus, can it be funcitoning with a HTC ? Using OpenVR it should work but I'd rather ask.

2) are there any necessary scripts or is this C++ only?

3) can it display HUD items ?

4) the implementation is not perfect ("Work Remaining, Issues and other Assorted Ramblings").

Do you plan to work on it again and improve it for T3D, or should we wait for a new version specific to T3D 4 ?

Link to comment
Share on other sites

1) I have tested with an Oculus Rift and HTC Vive and both work. In theory it should also support WMR devices, but I have no knowledge of anyone testing with WMR yet.

2) There is some script setup required, examples are included in the branch.

3) Yes, there is support for floating overlays and the OpenVR dashboard so you can render T3D guis directly in the headset.

4) It will be updated for the new e/c player controllers, but it's unlikely that will happen before T3D 4 releases. Hopefully shortly after though.

Link to comment
Share on other sites

  • 2 years later...

Thanks for doing all this and releasing it! 

This is 100% functional in 2021 with the Index + controllers, still using SDK build 1.0.17. I tried throwing 1.16.8 in, but enough has changed that I'll probably need to upgrade a few builds at a time, and for the moment this is working perfectly.

Only one proper technical issue so far: The LOD system doesn't function in VR (take a look a the vehicle in the empty terrain map). Will investigate. At the moment I just have it hacked to always use max LOD.

--- TL;DR portion below, discussing gameplay implementation details for VR in T3D

Right now you can reach parity with No Man's Sky by simply using the seated mode. This is more than sufficient for vehicle cockpits, and it's workable for a player character if you don't mind that it's not proper roomscale (you can walk away from your Player body). Like in NMS, you can just tell the player they've moved too far from their character body and do an auto-recenter. If concerned about the player putting their head through geometry, you can run a raycast every tick between the character's head and the VR HMD.

That plus putting the ShapeBaseImage on a tracked controller is sufficient for your basic singleplayer experience as long as you don't have too many narrow doorways. The player never sees their own body, it's just used for collision volume and taking damage, so they won't care that your hands and gun don't line up with the rest of the body.

I think for a basic crossplay multiplayer experience, getting the Player to line up its aim angle with the held VR gun should be sufficient. Limited, because it eliminates all the fun VR social interface of gestures and head tracking, but functional for putting VR and flat players into the same world. Your avatar will do odd stuff if you throw the gun around, but nothing more odd than what you can do now by spinning with your mouse.

I'm also running your GuiOnObject2 implementation for VR GUIs. Working on a hybrid of laser pointer and touchscreen, where you can point and click the trigger from a distance, but at very close range it will register as an auto-click like a touchscreen. It needs basic collision detection (prevent the hand from going through the screen) to work the way I really want it, where you would be able to touch and swipe to move a slider. Will share whatever I come up with on this if it's any good.

Edited by Atomic Walrus
Link to comment
Share on other sites

  • 2 weeks later...

@Atomic Walrus

Thanks for the detailed feedback. If you have your code for interacting with overlays via touch in a branch, I would really like to see how you've implemented that. The scrolling options added in 1.2.10 make it sound like that is going to become a standard feature.

The LOD issue you pointed out is a known issue and I believe it's been fixed it the Preview_40 branch. It had to do with the LOD calculation using screen pixels and aspect ratios that are very different between the screen and VR eye viewport.

I read through the release notes on the updates and it sounds like there have been many useful improvements. I have started a branch (https://github.com/OTHGMars/Torque3D-1/tree/ovr_1168_wip) to port this up to T3D Preview_40 and update to the current OpenVR release. Currently it has the bare minimum changes required to build against openvr 1.16.8. I have not started implementing any of the new features or porting the demo scripts yet.

Now that T3D has assimp integrated, we should be able to get rid of the intermediate step to create collada models for the hand meshes and load them directly from their fbx source art.

Getting rid of the HQ overlays (1.7.15) and standardizing is nice for us as it removes several confusing overlay setup options. There have been several changes to IVROverlay and IVRInput that sound very intriguing. The additional cursor control and feedback for input binds are nice features.

The compositor skinning (https://github.com/ValveSoftware/openvr/wiki/Compositor-Skinning) option added at 1.9 should overcome (or at-least minimize) the lag and grey-room issue that was (imo) the biggest deterrent to trying to use T3D for VR games. If that works as advertised, it will be possible to create a VR template that launches directly to the mainmenu in VR. That would certainly be a fun experiment to try.

If you have any features you would like added, don't hesitate to share ideas or PR changes. The 'Full' game template no longer exists, so a big portion of the work is going to be porting and updating the scripted demos to work with the 'BaseGame' template and 'FPSGameplay' module. Any thoughts or ideas on how that should be approached would be greatly appreciated.

Edited by OTHGMars
Fixed links.
Link to comment
Share on other sites

  • 4 weeks later...

There are still a few too many moving pieces with the 4.0 template to do the update and script port at the same time. I updated the original branch so the new features could be tested there before porting the scripts to 4.0. That code is here: https://github.com/OTHGMars/Torque3D/tree/ovr_1168_wip

The ResetZeroPose command has been moved from IVRSystem to IVRChaperone, so the chaperone interface has been added. With static and cursor overlays available, the offscreen canvas has been separated from the overlay to simplify overlay creation. An offscreen canvas can still be attached. The script demo has been updated to use the new format. It also provides a better example of virtual keyboard activation and input handling.

Link to comment
Share on other sites

  • 10 months later...

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