» Oculus Rift
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

Oculus Rift

plugin
Credits: Ported from the Unity3D wrapper and shader by herbst.

about

These nodes might be outdated, use 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.

download

OculusRift_DK2_v2.1.zip
10.09.14 [04:32 UTC] by reaktant | 1496 downloads
Based on OculusRift_DK2_v2 with some modifications and test scene. EXPERIMENTAL
Show 5 older revisions

Older Revisions

OculusRift-DK2-3.v4p
09.09.14 [21:14 UTC] by mediadog | 584 downloads
Wrapper patch for DK2_v2 plugin to get proper motion - HACK ALERT!
OculusRift_DK2_v2.zip
04.09.14 [18:30 UTC] by TidensBarn | 620 downloads
Orientation/Position-Tracking, working pins: Aspect ratio, Interpupillary distance, VerticalFOV
OculusRift_DK2.zip
29.08.14 [21:33 UTC] by TidensBarn | 598 downloads
Rudimentary support for DK2
OculusRift-20130706.zip
07.07.13 [03:53 UTC] by mediadog | 1180 downloads
Fixed right eye motion, added eyes X shift
20130529_OculusRift.7z
29.05.13 [18:05 UTC] by herbst | 656 downloads

metrowave 29/05/2013 - 20:09

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

mediadog 07/07/2013 - 01: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/07/2013 - 04: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/07/2013 - 08: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/07/2013 - 10: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/07/2013 - 17: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/07/2013 - 17: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/07/2013 - 18: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/07/2013 - 20: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/07/2013 - 17: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/07/2013 - 08: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 12/07/2013 - 00: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 12/07/2013 - 01: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/06/2014 - 09:56

anyone here who succesfully tested this contribution with b32?

reaktant 07/08/2014 - 14: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/08/2014 - 05: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/08/2014 - 11:56

cool.

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

mrboni 28/08/2014 - 11:12

any DK2 love yet? Have one arriving soon

mrboni 03/09/2014 - 14:27

Hi TidensBarn

Thanks for the update!

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

TidensBarn 04/09/2014 - 19: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/09/2014 - 10: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/09/2014 - 14: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/09/2014 - 21: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/09/2014 - 23:17

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

reaktant 10/09/2014 - 04: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/09/2014 - 14: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/09/2014 - 17: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/09/2014 - 22:10

Yes me too.

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

reaktant 12/09/2014 - 22: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 13/09/2014 - 01:12

even when that renderer is on the rift display?

tomeic 22/09/2014 - 14: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/01/2015 - 22: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/03/2015 - 11: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/03/2015 - 19: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/04/2015 - 09:46
sonostrano said
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/04/2015 - 17:22

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

isdzaurov 01/09/2015 - 21:43

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

I do not go out = (

manuel 06/08/2016 - 23:25

vvvv.openvr

anonymous user login

Shoutbox

~1d ago

joreg: The summer season of vvvv workshops at The NODE Institute is out: https://thenodeinstitute.org/ss24-vvvv-intermediates/

~1d ago

domj: If you happen to be in Prague, come join us at the Schema workshop on Thursday 25.4. :) https://www.facebook.com/events/395516526614988/?ti=ls

~13d ago

joreg: Postponed: Next vvvv beginner course starting April 29: https://thenodeinstitute.org/courses/vvvv-beginner-class-summer-2024/

~1mth ago

~1mth ago

joreg: The Winter Season of vvvv workshops is now over but all recordings are still available for purchase: https://thenodeinstitute.org/ws23-vvvv-intermediates/