Jump to content

Occulus Rift DK2 [ALSO: OpenVR]


MangoFusion

Recommended Posts

Another update....


Finally have a fix for both the scattersky and the lensflare - turns out torque3d likes to assume you have nice on-center projections when changing the frustum distances, which in the case of VR is not the case which was breaking the scattersky. Similarly the lens flare code was not projecting the suns position correctly for both eyes, nor was it correctly taking into account the center of the projection when calculating the flare direction.


EDIT: While there was an issue with side-by-side rendering this should now be fixed. Separate render targets also work properly.


Of course there is a fair bit of optimization to do, but my interest at the moment is just to get stuff working and optimize the hell out of it later.


At the moment i'd like to get controller support in soon, but i'm aware at the moment this stuff isn't too accessible for everyone else, so i'm looking to make a sort of WIP-demo or perhaps just resurrect one of the old oculus demos. Keep your eyes peeled I guess!

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 88
  • Created
  • Last Reply

Top Posters In This Topic

Time for another update...


Still working on controller support. Rendering of the controllers is in, just the interaction API needs to be worked on so you can interact with things in the game world. I'm also working on a new type of object from which the tracking origin can be based (for the controllers). This will probably also be incorporated into the player / vrplayer code.


Its come to my attention also that the reflection code is a little broken. Thankfully I finally have a solution for this and will be incorporating it into the repository soon.


I'm currently aiming to do a rebase of the branch to the latest development branch to incorporate fixes introduced to the current code. Also aiming to speed up development so I can get something incorporated into a pull request before the end of the month.

Link to comment
Share on other sites

Hi,


I have downloaded and compiled this repo, and it's all working, except for one minor issue.


I can build the repo, and run it in dx9 and dx 11 with no issues (except for some minor problem with controlling the camera).

However, when I add the openVR include files, I can build the engine, but running it gives me an "Unable to load game library" (mygame.dll") error.


This only happens when I include the openVR code. I've tried regenerating the project with dx11 included (and extended move) multiple times, multiple clean builds, etc.


I'm running windows 10 with up to date drivers, etc.


Anyone have any ideas?


Thanks!

Link to comment
Share on other sites

Ok, so I am almost there!


I have my rift, it's working great.


I am now attempting to run my T3D projects on it. I have enabled "unknown sources", and I am running the D3D11/Open VR example project given in this thread.


Without enabling VR, the project works fine, no issues.


When I enable VR (in windowed mode) the headset picks up an app being loaded, switches out of the home screen, but both my desktop view and the HMD view are black.

When I hit escape, I can see a message "are you sure you want to quit?" appearing on the headset and the desktop app.


When I run in fullscreen, I get a crash, something about DirectX not being able to run in full screen.


I am assuming I don't need to run in fullscreen mode? Is there anything obvious that I am missing here?

Link to comment
Share on other sites

I think I might have found the source of the issue. After creating the canvas with VR enabled, I see this error in the console:


"VR: HMD device has an invalid adapter."


I'm digging through the source now, Could this be the cause, or is it inconsequential?

Link to comment
Share on other sites

Ok, I didn't realise that SteamVR has to be running, I assumed just the Oculus app needed to be running.

I can now get video on my Rift, but I have no head tracking,and the camera position seems to be wrong. The controller also doesn't work, but that's not a major problem.

I will keep digging, I am almost there!


EDIT: I should point out that head tracking works fine in the Oculus Home screen, and all of the Rift Demos, so it's not a hardware issue.

Link to comment
Share on other sites

  • 3 months later...

So I've update our project to include the Basic OpenVR support code checked in a few days ago by Areloch, I've added the openVR files into the project, as well as openvr_api.lib, I turned on TORQUE_OPENVR, and everything is compiling and linking. I have a DK2, which is still working mostly. I removed all the Oculus specific files. Everything is compiling and linking. What do I have to do to get my project to just echo what it shows to the rift? Is there a lot of development that I am missing, or just some option I have forgotten to turn on?


Thanks for any advice

Link to comment
Share on other sites

Stevel:


I hadn't tried the openVR stuff with the rift, just the vive, but as far as I know, it should PROBABLY work.


There's some script-side stuff to add to make sure it renders to the headset canvas and stuff. I'll pull that out and update here for ya to try.


(As an aside, I'm working on making a VRCameraComponent to cut out a lot of these extra setup junk for the future)

Link to comment
Share on other sites

Alrighty, put this together from Mango's examples, so pull it down and give this a whirl


https://github.com/Areloch/Torque3D/tree/OpenVRFullTemplate


For the project/engine config, you should just need to tick the advanced options: TORQUE_EXTENDED_MOVE and TORQUE_OPENVR in cmake, hit configure, and there'll be a new option TORQUE_OPENVR_SDK_PATH. Put in the path to the openVR SDK and hit generate.


Recompile and the engine side'll be good. If you grab the link to my one branch and use the changes in the full template, you should be good.


Hadn't tried it with the rift, only the vive, but it should all check out on that front at least.


Lemme know if you run into any trouble spots.

Link to comment
Share on other sites

Thanks for this. I seem to have gotten the code up and running, and I am seeing a split screen in my project on the monitor, but when I look into the rift, I just see a little hourglass icon. Not sure what is going on here, but I will post if I have any useful information about it. (I have a DK2, and get warnings from the oculus software that it's not supported, but it still works with the demos.) I should try this in the T3D directly, not just in my project, and see what it does there.

Link to comment
Share on other sites

Thanks for this. I seem to have gotten the code up and running, and I am seeing a split screen in my project on the monitor, but when I look into the rift, I just see a little hourglass icon. Not sure what is going on here, but I will post if I have any useful information about it. (I have a DK2, and get warnings from the oculus software that it's not supported, but it still works with the demos.) I should try this in the T3D directly, not just in my project, and see what it does there.

 

Yeah, like said, only tried the openVR with the vive, not the rift, but if you spot anything in the logs, or find any details, feel free to post it here and we can try and hash things out.

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