hecomi / uDesktopDuplication

Desktop Duplication API implementation for Unity (only for Windows 8/10)
http://tips.hecomi.com/entry/2016/12/04/125641
MIT License
564 stars 97 forks source link

Quest 2 Oculus / Open XR Issues Rendering in Right Eye #52

Open sargrvb opened 3 years ago

sargrvb commented 3 years ago

Hey guys, hoping this git is still alive. I ran into an issue after some experimenting in unity. Putting the default Monitor Board in my scene ended up working fine until something in my scene switched. Unfortunately, I wasn't able to pin down exactly what causes the issue, but it appears as if the shader isn't rendering out of the right eye. I googled around and discovered this was a persistent bug usually relating to one of two things:

A. Single pass vs Multi Pass. I tried both, still no luck with the prefab.

B. Shader not supported in VR / not set up for stereo camera. I'm not sure how to modify the files to fit with my game, but I'm actively trying to figure it out.

Is there anyone here experiencing the same issue? For now, I just ended up switching materials, but that gets rid of most of the functions like bend, culling etc. It would be nice to have a shader that worked in the demo rather than having to modify my own. I'll keep looking around in the meantime and see if I can find a solution that's more permanent.

Marco-Zechner commented 2 years ago

What RP do you use? I tried it with Legacy and URP and both work "fine". Make sure you have selected both eyes in the camera.

btw. can you read the text fine in VR? (on the one eye it works at least) When I try to read the text from the Editor on the Screen in VR then I can't until I get way too close to be comfortable to work with it.

I use the OpenXR Plugin > 1.2.8 > PlayerRig

Marco-Zechner commented 2 years ago

Oh I found your problem at random. In XR -> Oculus you have to use Multi Pass. Maybe you have single pass and another problem and that's why you don't see a difference by multi pass

hecomi commented 2 years ago

Sorry for the late reply....

Single Pass (Instanced) was supported in pull request #41, but I didn't check it with Single Pass. Multi Pass is designed by Unity to work without any changes from the non-VR shaders, and many projects are using this plugin for their VR products, so I think it will work fine.

Could you try this with a built-in shader such as Unlit? Actually you don't need to use shaders that comes with uDesktopDuplication just to display desktop textures.