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

Oculus Rift

plugin device sensor oculus
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 | 1212 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 | 302 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 | 382 downloads
Orientation/Position-Tracking, working pins: Aspect ratio, Interpupillary distance, VerticalFOV
OculusRift_DK2.zip
29.08.14 [21:33 UTC] by TidensBarn | 358 downloads
Rudimentary support for DK2
OculusRift-20130706.zip
07.07.13 [03:53 UTC] by mediadog | 908 downloads
Fixed right eye motion, added eyes X shift
20130529_OculusRift.7z
29.05.13 [18:05 UTC] by herbst | 414 downloads

metrowave 29/05/2013 - 19:09

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

mediadog 07/07/2013 - 00: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 - 03: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 - 07: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 - 09: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 - 16: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 - 16: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 - 17: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 - 19: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 - 16: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 - 07: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/07/2013 - 23: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 - 00: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 - 08:56

anyone here who succesfully tested this contribution with b32?

reaktant 07/08/2014 - 13: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 - 04: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 - 10:56

cool.

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

mrboni 28/08/2014 - 10:12

any DK2 love yet? Have one arriving soon

mrboni 03/09/2014 - 13:27

Hi TidensBarn

Thanks for the update!

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

TidensBarn 04/09/2014 - 18: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 - 09: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 - 13: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 - 20: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 - 22:17

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

reaktant 10/09/2014 - 03: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 - 13: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 - 16: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 - 21:10

Yes me too.

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

reaktant 12/09/2014 - 21: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 - 00:12

even when that renderer is on the rift display?

tomeic 22/09/2014 - 13: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 - 21: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 - 10: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 - 18: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 - 08: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 - 16:22

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

isdzaurov 01/09/2015 - 20: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 - 22:25

vvvv.openvr

anonymous user login

Shoutbox

~22min ago

joreg: @soundreactor: we're not aware of any.

~2h ago

soundreactor: is there speed throttling for downloads? i only get 46kb/s TX,USA

~4h ago

bauhausorbits: Hey in case you are thinking about joining tomorrow’s c# in gamma workshop, you may pm me to take over my place :)

~2d ago

ravazquez: Just your regular hungarian folk dance shellsort: https://youtu.be/CmPA7zE8mx0

~2d ago

joreg: Reminder: This thursday in #berlin: free introductory workshop to the all new #vvvv gamma: https://nodeforum.org/announcements/series-of-free-2h-introduction-workshop-to-vvvv-gamma/ #visualprogramming

~4d ago

evvvvil: My refracted brutalism shader... Sucking sweet refracted milk off the tits of schlick fresneled reflections. https://www.shadertoy.com/view/wt33RN

~5d ago

io: @sinao build the cube in a 3d editor soft such as Blender and do the UV mapping there

~6d ago

sinao: one side

~6d ago

sinao: How to apply texture only on one of a cube?

~6d ago

tonfilm: Just updated the CraftLie rendering pack to latest: craftlie-dx11-drawing-for-vl