Programming VR with openFrameworks

To work with VR using openFrameworks, you can use ofxOpenVR addon: https://github.com/perevalovds/ofxOpenVR

It's implementation of Valve Software's OpenVR API, which was originally developed by smallfly https://github.com/smallfly/ofxOpenVR, next I forked it into Kuflex repo, and finally to my repo. The most important fix comparing original version is about problem of one eye's vertical shift due matrices computations errors.
This addon lets create VR applications (using HTC Vive) on openFrameworks, Windows 10.
It's using oF's programmable render.

Requirements

  • HTC Vive (though, it is not required to compile projects, just to deploy) and Steam VR
  • Visual Studio 2017
  • openFrameworks 10.1
  • ofxOpenVR addon folder, which should be placed to openFrameworks/addons/ofxOpenVR.

Running examples

  • To check addons is working, compile and run its examples located in openFrameworks/addons/ofxOpenVR.
  • There are two examples: example-360Player - draw panoramic image in VR, and example-drawing - drawing lines in VR using joysticks.
  • Note, examples are intended to be compiled in 64-bit mode because they contain 64-bit version of openvr_api.dll.

Using addon

For developing your own projects, use examples as a scretch, or create the project using Project Generator, and copy openvr_api.dll file to the bin folder of the project from copy_to_bin addon's folder (depending on 64 or 32 bits mode you are required).

Comments

  1. I have ofxopenvr examples running in windows 10 with the vive but the vive is only showing the deafult steamvr intro game. The openframeworks example is just a grey window with the help text. Did you encounter similar issues?

    ReplyDelete
  2. It look liks oF doesn't see Vive. Did you install OpenVR drivers?

    ReplyDelete
    Replies
    1. There were so many issues with getting the ofxOpenVR examples running that I just took out what I needed from the addon files and mostly used OpenVR directly.

      Currently I am trying to get ofxShadertoy code running using an FBO to pass a texture. Unfortunately it is only showing up in the right eye.

      If I set up and load the FBO in setup it shows up in both eyes but I can't refresh the time uniform in the shader so the point of using Shadertoy is lost.

      Do you offer consulting? Please. Or send me in someone's direction. Please.

      Delete
  3. Hi, can i make VR in Android with oF?

    ReplyDelete

Post a Comment

Popular posts from this blog

Computing ray origin and direction from Model View Projection matrices for raymarching

Forward and backward alpha blending for raymarching

Forward, Deferred and Raytracing rendering in openFrameworks and web