Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Linux and OSX Support #215

Open
demonixis opened this issue Mar 31, 2017 · 4 comments
Open

Better Linux and OSX Support #215

demonixis opened this issue Mar 31, 2017 · 4 comments

Comments

@demonixis
Copy link
Contributor

demonixis commented Mar 31, 2017

Hi,

For now the Linux and OSX support is pretty bad but it can improved with two things

  1. Using the distortion correction shader provided in this project
  2. By moving the window in the HDK screen position

I've implemented the OSVR SDK in my game engine and of course, RenderManager is not yet supported. BUT I was able to get distortion correction by porting your post process. Please use it when RenderManager is not available.

For the second point, we can open a new window on the location of the HMD using this API.

I can help to do that, what do you think about? Adding this will bring a better support of OSVR on Linux and it's required.

Edit: You can find a working version of the post process here.

image

@russell-taylor
Copy link
Contributor

Cool, thanks! Is there a barrier other than the time it would take to porting the RenderManager Unity plug-in to Linux or OSX?

@demonixis
Copy link
Contributor Author

demonixis commented Apr 1, 2017

Well the port of the current plugin to Linux and OSX requires OpenGL support and it doesn't work for now. I don't know why, maybe a difficulty on the Unity side.

However, the rendermanager branch on the Managed-OSVR looks promising. According to @JeroMiya It's not yet finished and only supports OpenGL. To work, it requires a pointer to the OpenGL or DirectX texture and Unity allows us to get that from C#. So I think that a native plugin is not required if this branch can be finished/stabilized.
Having Managed-OSVR complete will allows other C# engine to enjoy OSVR.

In very short term, I think we can implement two feature to the current Unity SDK

  1. Distortion correction, it's easy, I have published the effect we need (see my previous screenshot) and you can use that code to get the K1 parameters.
  2. Detect where is the OSVR HMD display (screen 2, 3 ?) and open a new window into that screen. Unity can handle multi monitors, so we just have to push the dual camera view on that screen and keep a preview (the left eye by example) on the main screen.

Edit: I have updated my fork and added the distortion correction if RenderManager is not available. I have to test it first.

@DuFF14
Copy link
Member

DuFF14 commented Apr 2, 2017

OpenGL support is working on Windows in extended mode. Direct mode won't work on OSX or Linux anyway, right? For OSX and Linux support, the platform-specific context sharing code needs to be ported. Specifically, this call to wglShareLists is only available on Windows:
https://github.com/OSVR/OSVR-Unity-Rendering/blob/oglSupport/OsvrRenderingPlugin.cpp#L283

This splits to another branch for OSX support, and I just pushed my most recent commits which haven't been tested.
https://github.com/OSVR/OSVR-Unity-Rendering/compare/oglSupportOSX

@demonixis I will take a look at the PR

@demonixis
Copy link
Contributor Author

demonixis commented Apr 3, 2017

Hi,

Yes the plugin works well on Windows (Direct mode is good and as you said, OpenGL works in extended mode), you've made a nice work on it. But as I said, i've implemented the OSVR SDK into my own engine so I learnt a lot about OSVR recently.
I believe if we use a complete binding of OSVR (Core + RenderManager) we can bring some RM features to Linux and Mac too in extended mode. That's what gamers on those OSs want.
My pull request that adds Distortion correction is clearly not perfect, it's a temporary fix for a majority of uers on Linux and Mac which use an OSVR HDK.

I don't know but some methods fails to call from native code, you can see that in my last PR too. I've also opened an issus on the Managed-OSVR repository OSVR/Managed-OSVR#41 and talked a bit about that with @JeroMiya .

Some parts of MonoGame-OSVR could be merged into Managed-OSVR (json descriptor parsing by example), because with a finished binding of RenderManager, we can avoid the native plugin and have a better support for other OSs.

Why do I have opened this issue? Because I'm a game developer for my own and for a company and in both cases, we use OSVR. It's impossible to sell a game or an application on Linux and Mac because it doesn't work as expected. And what do we want on those OSs?

  • Distortion correction
  • Automatic Window placement
  • Timewarp

All these features are supported on Linux and Mac with any GPU. So yes it's just a binding to finish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants