Skip to main content
Up and Coming
May 11, 2014

SharpOVR 0.4.2 NuGet Update

I've released a NuGet package called SharpOVR, it's a .NET API for the Oculus Rift. It is based on SDK 0.4.x and wraps most of the functionality provided by the SDK. It only supports SDK Rendering at the moment (no Client Distortion Rendering). It has a dependency on SharpDX for the Matrix, ViewportF, Vector and Point classes.
https://www.nuget.org/packages/SharpOVR/

Here's how to use it:

OVR.Initialize();
using (HMD hmd = OVR.HmdCreate(0))
{
// Configure rendering, configure tracking, BeginFrame, EndFrame, etc
}
OVR.Shutdown();

It targets the "Any CPU" platform as the assembly embeds both Win32/x64 unmanaged dlls and loads the appropriate one at runtime. In other words, just add the NuGet package to your project and you're good to go.

I've created a sample SharpDX game project (shown below) that can help you get started.
SharpOVR Sample



Let me know if you have any questions/suggestions.

Guy

    51 replies

    guygodinAuthor
    Up and Coming
    August 30, 2014
    "rob0" wrote:
    First off: Thanks for making and contributing SharpOVR it is really awesome.
    I am currently playing with SharpDX rendering and I have a few questions about your library.

    1. The only license I can find is the Oculus LibOVR license, how do you plan to license SharpOVR and are you planning on releasing the source?

    2. The current nuget release is bound to the signed 2.6 desktop/d3d11.2 sharpdx dlls. Is there some reason for this tight binding? Are you planning on releasing alternate versions for each version/build variation of sharpdx?

    3. The MatrixOrthoSubProjection method produces non-aligning results across the eyes when rendering sprites. I am not sure which one is right as the sprites are visible in both eyes, but in very different positions. Am I missing something (like a specific value for an eye-specific parameter) with the usage of this method? Or do I have to have to perform additional steps beyond applying the projection to get correct ortho rendering?

    Thanks again for your work on this.

    1. No plans on releasing source. You can use SharpOVR freely, same license as LibOVR
    2. The NuGet only has a dependency on SharpDX 2.6, you can use it with any other version beyond 2.6
    3. You might want to look at the GetTranslationMatrix extension method when calculating the view offset. I haven't used the orthodox projection so there might be a bug.
    Virtual Desktop Developer
    New Participant
    August 30, 2014
    Can this library be used as a managed bridge for Unity free? From what I understand Unity Free allows imports of managed dll's but not unmanaged dll's. Theoretically could SharpOVR be used a managed bridge and bypass this restriction? If this is remotely possible, I'm curios if the SharpDX dependencies would cause any conflicts.
    guygodinAuthor
    Up and Coming
    August 30, 2014
    "jespinoza1983" wrote:
    Can this library be used as a managed bridge for Unity free? From what I understand Unity Free allows imports of managed dll's but not unmanaged dll's. Theoretically could SharpOVR be used a managed bridge and bypass this restriction? If this is remotely possible, I'm curios if the SharpDX dependencies would cause any conflicts.

    I don't know but my guess would be probably not.
    Virtual Desktop Developer
    New Participant
    August 30, 2014
    "guygodin" wrote:
    "jespinoza1983" wrote:
    Can this library be used as a managed bridge for Unity free? From what I understand Unity Free allows imports of managed dll's but not unmanaged dll's. Theoretically could SharpOVR be used a managed bridge and bypass this restriction? If this is remotely possible, I'm curios if the SharpDX dependencies would cause any conflicts.

    I don't know but my guess would be probably not.


    I would say not as well. According to this page http://answers.unity3d.com/questions/333829/including-a-dll-in-unity.html, Unity expects .NET 3.5 and below. I don't know if this is still accurate, but I assume it is since Unity doesn't seem to like the current 0.4.1 build which appears to be built with .NET 4.0. I also think that the SharpDX bindings would cause some issues. Still, it would be a novel experiment.
    Participant
    August 31, 2014
    Can't get past OVR.Init http://screenshots.ryotsuke.ru/scr_cccb168138d6.png
    Any advice on that? SDK is installed, Oculus is ON
    Participant
    August 31, 2014
    I also was getting "Can't find msvcp120.dll" but I've just put these in build folder
    guygodinAuthor
    Up and Coming
    August 31, 2014
    The LibOVR is compiled with VS2013 so you'll need the C++ 2013 Redistributable installed when developing with prior versions.
    Virtual Desktop Developer
    guygodinAuthor
    Up and Coming
    September 4, 2014
    SharpOVR has been updated to the latest 0.4.2 SDK
    Virtual Desktop Developer
    Participant
    September 5, 2014
    My c# dx engine (if you can call it that) uses SlimDX rather than SharpDX.
    Do you think it would be fairly trivial for me to convert it to use SlimDX?


    Another SlimDX user here, just curious if anyone got this or anything else working with their SlimDX-based project.
    i7-4770K, 2x GTX 780 SLI, Windows 7 64-bit, Oculus runtime 0.6.0.0
    New Participant
    September 5, 2014
    This is maybe a dumb question but would it be possible to use sharpovr and render to the rift without the sharpdx game class?