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

Unity-OSVR plugin renders everything flipped in direct mode #311

Open
raunaqbn opened this issue Apr 7, 2017 · 10 comments
Open

Unity-OSVR plugin renders everything flipped in direct mode #311

raunaqbn opened this issue Apr 7, 2017 · 10 comments

Comments

@raunaqbn
Copy link

raunaqbn commented Apr 7, 2017

-When I try and run the OSVR-Unity plugin based Game example with the the OSVR render manager configured to render in direct mode all the rendering appears flipped on the x-axis.
-Examples like the OpenGL 3D cube and the Direct X render correctly.

  • In Unity everything appears flipped.
  • I would like to emphasize that this happens with direct mode enabled.
@DuFF14
Copy link
Contributor

DuFF14 commented Apr 8, 2017

What display are you using? Display rotation is defined in the RenderManager config:
For HDK2 it should be:

"display": {
	"rotation": 180,
	"bitsPerColor": 8
},

from: https://github.com/OSVR/OSVR-Core/blob/master/apps/sample-configs/osvr_server_config.renderManager.HDKv2.0.direct.json

@raunaqbn
Copy link
Author

I am using a custom display where the native mode is potrait so I had to set the rotation to 270 to get direct mode working.
Importantly the RenderManagerPresentD3DExample and SteamVR seems to be working fine. It's only unity that appears flipped.

@LoSealL
Copy link

LoSealL commented Apr 12, 2017

The Unity creates texture different from native d3d example.
The unity texture is upside-down compare to native d3d.
You could manually revert it in rendermanager config file.

@russell-taylor
Copy link
Contributor

There is a flag parameter to PresentRenderBuffersInternal() called flipInY that the OSVR Unity plugin uses to invert this. If you are using the OSVR Unity plugin, this should be happening automatically. If you are writing your own plug-in, you will need to set this flag. It sounds like you are using an example program that is not behaving properly. Please post a link to that so we can see which one is not working and fix it.

@raunaqatmeta
Copy link

@LoSealL Can you point me to the config parameter? In any case wont setting up the render manager config also effect the native application and flip everything there? Is there a way this can be handled in the plugin or Unity scripts?

@raunaqatmeta
Copy link

@russell-taylor I am using the OSVR Unity plugin available in the asset store and not writing my own plugin. Is there a native plugin src code where I can modify the flipInY parameter you mentioned? I could not find it here..

All the samples have the same issue I mentioned and it;s not just a single sample.

@russell-taylor
Copy link
Contributor

If you're seeing it in the stock plug-in, I'm going to have to bump you to @DuFF14 for further help. I work on RenderManager but he has done the plug-in.

@DuFF14
Copy link
Contributor

DuFF14 commented Apr 18, 2017

@raunaqatmeta the flipy parameter is here: https://github.com/OSVR/OSVR-Unity-Rendering/blob/master/OsvrRenderingPlugin.cpp#L838

What display config are you using?
Which version of Unity?

@LoSealL
Copy link

LoSealL commented Apr 19, 2017

@raunaqatmeta the contributors taylor and duff14 has mentioned the parameters in either config files and the codes.
If you just change the settings of Unity Plugin, that won't affect other apps, if you change the setting of rendermanager, however that would affect all the apps

@raunaqbn
Copy link
Author

@DuFF14 : I modified the flipInY parameter and set it to false and that fixed the distortion issue. However that caused an issue with the head position rotation data being inverted.

What display config are you using?

I am using the custom display config.

Which version of Unity?

5.4

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

5 participants