• Home
  • Documentation
  • Forum
  • Blog
  • Users
    • Map
    • Userlist
    • Businesses
    • Userpages
    • Connections
  • Contributions
    • All
    • Store
  • Downloads
    • vvvv beta
    • vvvv beta previews
  • Store
Show / Hide Table of Contents

Oculus Rift

Author: herbst
Date: 29 May, 2013
Category: plugin
Credits:

Ported from the Unity3D wrapper and shader by herbst.

Download

64bit

5-OculusRift_DK2_v2.1.zip
10 Sep, 2014 - 02:32
Based on OculusRift_DK2_v2 with some modifications and test scene. EXPERIMENTAL
4-OculusRift-DK2-3.v4p
09 Sep, 2014 - 19:14
Wrapper patch for DK2_v2 plugin to get proper motion - HACK ALERT!
3-OculusRift_DK2_v2.zip
04 Sep, 2014 - 16:30
Orientation/Position-Tracking, working pins: Aspect ratio, Interpupillary distance, VerticalFOV
2-OculusRift_DK2.zip
29 Aug, 2014 - 19:33
Rudimentary support for DK2
1-OculusRift-20130706.zip
07 Jul, 2013 - 01:53
Fixed right eye motion, added eyes X shift
0-20130529_OculusRift.7z
29 May, 2013 - 16:05

Description

Note: These nodes might be outdated, use [VVVV.OpenVR](xref:contribution/vvvv.openvr) for VR related projects.

Here is an initial take on the Oculus SDK (sensor access + distortion shader). It's mostly ported from the Unity3D stuff.

Note that there seems to be buggy behaviour in vvvv in regard to the HID device (Tracker DK) that the Oculus installs. If vvvv is running (has nothing to do with this patch, just open vvvv), no other application can access the Oculus. And, more importantly, vvvv will prevent itself from using it if just started.

The current workaround seems to be:

  • another application (e.g. PreventDeviceEnumeration.exe) has to open a connection to the Oculus,
  • start vvvv and open the oculus patch,
  • disable the OculusRift node,
  • close the other application,
  • enable the OculusRift node in the patch. Could of course be done with a .bat file or something.

A simple .exe (PreventDeviceEnumeration.exe) which just opens a connection to the device and streams the values is provided within this package, so you can block vvvv from doing it's dark, sinister and unfortunate magic.

Comments

Comments are no longer accepted.
Please create a new topic in the vvvv beta forum to discuss this contribution.
metrowave
29 May, 2013 - 18:09

Thanks a lot herbst, vvvvery useful when I finally get my Rift...

mediadog
06 Jul, 2013 - 23:00

Hey Herbst! Thanks again for this, and particularly the USB workaround. I've found that on WinXP it works without it; it seems to be a Win7 problem.

FINALLY got my Rift! And found there is an error in your patch: the right renderer has nothing connected to the View pin and so does not rotate.

I can see no depth in the blocks - as if the perspective shift is not occurring. I'll poke around on it...

Also, the demo program in the 0.2.3 SDK has lower tracking latency than this plugin - is there a way to make this use the more recent libs? Thanks!

mediadog
07 Jul, 2013 - 02:02

Okie doke, this version works for me. That rotation was evil, I think that made it hard to see the lack of eye parallax (besides making me dizzy!). Tested with 29.2_x86 and 30.2_x86 on Win7.

mediadog
07 Jul, 2013 - 06:57

Ooops, made a little mistake in my change to OculusRift.v4p - the two Translates that are going to the Transform input pin of the two PerspectiveOffset nodes should be using half the InterpupillaryDistance output of the OVRDevice node instead of the LensOffset output. It should be positive into the left Translate X, negative into the right.

I was able to quickly drop my depth camera head tracker into this, and was able to look down at my body and outstretched arms as a point cloud, too weird!

I've got some other changes to make a more general patch and will upload that soon.

(WHY can't we attach .v4p files here?!)

herbst
08 Jul, 2013 - 08:55

Hey mediadog, if you're sure about the wrong connections, go ahead - I ported directly from Unity and tried to make the same calculations as were done in the code there, but of course I may have done a mistake.

mediadog
08 Jul, 2013 - 15:32

The original patch was just missing the eye perspective shifts (and the right eye orientation) - it had the image shift to compensate for the Rift display, but that's a 2D shift of the overall image. The "camera" of the two generated eye renders need to be separated in local X position by the interocular (interpupillary) distance as well. The wrong connections were in my first addition to add the perspective shift.

I'm not suggesting I did it the right way in this "fix", but I do have "correct" (;^}) stereoscopic patches which work very well with my VR wall, and I'll add those in once I get them checked out.

Your work here really is a great help, I was able to get up and running in a couple of hours. Now I need to figure out how to make the Rift wireless!

mediadog
08 Jul, 2013 - 15:51

Concerning the HID grab by vvvv: it appears the HID nodes do scan and get all HID devices (there are some messages logged on the console during startup). I tried adding an HID Device node, setting the Device Type pin to "Tracker DK", and then the Enable pin to False, but it still was not seen by the Rift plugin.

Looks like there needs to be some way to really release an HID device via the HID nodes, and then initialize the Rift.

metrowave
08 Jul, 2013 - 16:16

jannis had done some interesting project recently using the Oculus Rift: http://www.youtube.com/watch?v=-k3WqT0ltSs&feature=youtu.be

I think initially it's based on herbst patches.

mediadog
08 Jul, 2013 - 18:08

I think you're right, because those images appear to be lacking eye shift as well. If you freeze the video when there are objects very close, you can see there is no shift in them relative to the background between the right and left images - like there is when you look at your thumb in front of you and alternately blink your eyes, objects in the distance jump sideways.

There are many things that make up depth perception, R/L parallax just being one - so there is still a sense of depth even without it due to shading and relative motion. So when you freeze the motion the lack of parallax is more apparent.

And interestingly, about 10% of the population doesn't register R/L shift at all, so it adds nothing to their depth perception.

jannis
09 Jul, 2013 - 15:27

Hey guys, thanks for the contributions! Everythings really nice, but... the Oculus keeps disconnecting permanently. When banging the Oculus again it's back to work, but this behaviour comes ang goes quite randomly...sometimes very often, sometimes stable for some time. TTY says nothing...it's getting worse with a heavy patch. Any ideas? Did you get the same behaviour? It's a big problem because the Oculus always needs to face the same direction for calibration, so as someone walks around and is not looking in one direction it's really a problem to rebang when the connection is lost... Thanks!

mediadog
11 Jul, 2013 - 06:05

Yes jannis, I have seen that too. Seems to only happen a few times when I first start using it, and then doesn't again. Also only seen it happen on one machine of two I've tried it on (oddly the faster one).

This plugin I believe is using an older version of the Rift SDK; updating may fix it but not sure what's required to do that.

@Herbst: there are two different "OculusPlugin.dll" files in the zip file, one in the base folder, and another (newer) down in the plugins\DevicesOVRDevice\bin\Dynamic folder. Wasup wid dat? (;^}) Thanks!

herbst
11 Jul, 2013 - 22:38

I can also remember that disconnect thing happening, but as mediadog says it seemed to never happen again after some initial hickups.

A temporary solution would be to S+H the last value you got and use that as an offset after reconnecting.

@mediadog: the one in the /bin/Dynamic folder is the one used, the other might be older/not from the Unity port.

For anyone who wants to update the plugin: just download the current version of the Unity SDK for Oculus, switch the dlls and the code... the modifications between the Unity and vvvv code are minor, basically I embedded the Unity one into vvvv.

jannis
11 Jul, 2013 - 23:18

Thanks guys. I think this is a really funny behaviour that the Oculus stabelizes after many hickups after starting the patch. So we all encounter the same problem. It was not so bad when I started patching but as the patch got heavier, the disconnection problem occured more often. It stabelizes, but not to a degree that makes me truly happy. Shouldn't disconnect after all :-) Or only once a week :-) I think it's worth updating the SDK especially if it's not that big of a deal. I tried with 2 Oculus set's and 2 PC's with different setups, various vvvv beta's, the disconnection occured on all systems. Let's update :-)

tmp
11 Jun, 2014 - 07:56

anyone here who succesfully tested this contribution with b32?

reaktant
07 Aug, 2014 - 12:23

Hello,

thanks herbst and mediadog.

Did anyone got this working for DK2 / Oculus SDK 0.4 already? I tried briefly but did not get any tracking output.

mediadog
09 Aug, 2014 - 03:43

No luck here either with the DK2. The DK2 uses a service now to handle the orientation data, so it's no longer via the USB. I expect the SDK is quite different and the plugin will need some mods, even just to get it to work in desktop-extension mode much less the DK2 custom renderer. If I can get some time in the next week I'll take a hack at it.

reaktant
09 Aug, 2014 - 09:56

cool.

By the way, is there some general guideline converting Unity classes to vvvv?

mrboni
28 Aug, 2014 - 09:12

any DK2 love yet? Have one arriving soon

mrboni
03 Sep, 2014 - 12:27

Hi TidensBarn

Thanks for the update!

Did you get anywhere with getting the rest of the info out?

TidensBarn
04 Sep, 2014 - 17:21

Hi mrboni,

just added a new update. Most of the info is outputed now. Some parameters seem to be completely missing in the new API, though. Maybe I'll manage to make the new direct-to-rift-mode work with vvvv, which would make retrieving these parameters obsolete anyway, I guess..

sonostrano
05 Sep, 2014 - 08:37

With which version of vvvv and OculusSDK is last plugin working? I'm using vvvv 32 and 0.4.2 oculus sdk and the OVRDevice node is always red

EDIT: It's working now. I missed some visual studio libraries

sonostrano
09 Sep, 2014 - 12:53

So last plugin (TidenBarn's) is working for me, but I've got a strange behaviour. If face forward and then rotate the head up, down, left and right; all camera rotations are correct. But if I turn my head 90° right (or left) and then look up or down, camera rotation is all wrong. Why is this happen? Please help

mediadog
09 Sep, 2014 - 19:12

Yes, it appears the Rift SDK is using a different coordinate system than vvvv, or at least than the DK1 (or this plugin is not handling it the same). I made some hacks to get the rotations and position to work in the "proper" direction.

I also made some changes to fix the stereo eye offset once again, and also this plugin in already reporting the interocular distance of a single eye so I removed the divide-by-2.

What I did here is a total kluge, and I think the distortions, aberration, resolution, etc. still need fixing but hey it works! Thanks TidesBarn!

Now how to attach a patch here, without making a whole new download...?

mrboni
09 Sep, 2014 - 21:17

how are you guys getting the missing values like for the distortion?

reaktant
10 Sep, 2014 - 02:46

added my current version with a small test scene. not sure if this is helpful, but worked quite well here already. start with OculusRiftDK2-ROOT.v4p

mrboni
12 Sep, 2014 - 12:26

I still don't get how you guys are correcting the distortion. I see that in the new SDK the distortion happens using a mesh rather than pixel shader as before, so there aren't any distortion coefficients.

In the absence of that data from the SDK are you manually tweaking the DistKXYZW values?

reaktant
12 Sep, 2014 - 15:32

hey mrboni,

i just took what tidensbarn came up with (thanks!) and tried to correct the orientation problem that sonostrano mentioned by tweaking.

what i got is most probably not the most optimal solution and should not be considered final, as slight derivations happily introduce nausea and disorientation.

so i would be interested as well how some of this works, and also if there is a way to get direct-to-rift with 75Hz working.

https://developer.oculusvr.com/forums/viewtopic.php?f=17&t=1341 https://developer.oculusvr.com/forums/viewtopic.php?f=20&t=1378

mrboni
12 Sep, 2014 - 20:10

Yes me too.

You can set the renderer to 75hz in inspektor btw.

reaktant
12 Sep, 2014 - 20:55

ok, good to know that it should work. there seems to be a problem with my nvidia driver then. the refresh rates dropdown in monitor settings shows an empty list and hr. inspektor offers only 50, 59, 60 frames.

mrboni
12 Sep, 2014 - 23:12

even when that renderer is on the rift display?

tomeic
22 Sep, 2014 - 12:19

Hey, is anybody having luck with the distortion mesh? When i try only this one function: hmd.CreateDistortionMesh(...) in the Plugin i get an "Index out of range" Exception. No clue what to do.. Could the problem be inside the OculusSharp.dll?

Lucidlien
10 Jan, 2015 - 20:42

Hey guys, I'm trying to run my Oculus patch on a friends computer and I get a red OVRdevice node, do you have any idea what could be wrong?

I installed Unity, and I'm happy to say it is working now.. But I do wonder why.. maybe it's the .net framework it needs, I'll check it out later

StiX
12 Mar, 2015 - 09:41

bump here, anybody got this working in direct access? anybody have idea woul would be needed?

right now, when i run oculus in direct access, the tracking and accelerometer data works, as soon as i run it in extended mode, it does not work

pechart
26 Mar, 2015 - 17:56

This looks like it works for me at first, but how can I get rid of the clipping in the render?

just a sphere to map some footage onto. clipping ocurs.

achim
19 Apr, 2015 - 07:46
quote:sonostrano: EDIT: It's working now. I missed some visual studio libraries

Same here, OVRDevice is always red. Which libraries do I miss? @ all that got it working: which versions of v4 and DK runtime are you running?

tomeic
24 Apr, 2015 - 15:22

Have a look at the newer, slightly better plugin for the Oculus Rift, here: ((oculus-rift-dk2-0)))

isdzaurov
01 Sep, 2015 - 19:43

Hi guys! It works c oculus dk2, sdk 0.6 and vvvv 45beta34.1 x64?

I do not go out = (

manuel
06 Aug, 2016 - 21:25

vvvv.openvr

  • Improve this Doc

© 2020 by vvvv group. Imprint | Privacy Policy.
Thanks to DocFX for building this website. Analytics by Plausible.

Back to top