MixedRealityToolkit / MixedRealityToolkit-Unity

This repository holds the third generation of the Mixed Reality Toolkit for Unity. The latest version of the MRTK can be found here.
BSD 3-Clause "New" or "Revised" License
400 stars 105 forks source link

[BUG] The image displayed on left eye is with significant deviation as right eye with URP used. #720

Closed Hanning-Liu closed 6 months ago

Hanning-Liu commented 6 months ago

Describe the bug

The canvas buttons are not displayed correctly on both eyes of HoloLens2 when the URP used. And the image is very laggy. The left eye will become fully white and the right eye can not see anything when the custom renderer feature is used.

To reproduce

  1. Install MRTK3, and OpenXR using MRTK feature tool
  2. install URP from unity package manager
  3. configure the MRTK remoting settings
  4. Hit the play button to start holographic remoting with HoloLens 2
  5. Add the Canvas and buttons from the Hierachy window
  6. See the images displayed on HoloLens on device, or through the Game "Preview" window in Unity (Turn on both Eyes setting)

Expected behavior

Images on both eyes are displaying the same images and being not laggay. Works well with custom renderer feature of URP.

Screenshots

https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/assets/42676581/414cb60f-ea27-4bdf-8fae-86355972b6f3

Your setup (please complete the following information)

Target platform (please complete the following information)

BenediktTobias commented 6 months ago

Usually a simple restart of the project fixes that shader issue that may occur directly after installing URP. If the issue still persists after a restart, try to rebuild Unity's shader cache. To do this simply delete [ProjectName]/Library/ShaderCache and restart your project.

AMollis commented 6 months ago

@Hanning-Liu what shaders are you using? Is everything in you're scene using shaders from the Mixed Reality Graphic Tools? https://github.com/microsoft/MixedReality-GraphicsTools-Unity

Hanning-Liu commented 6 months ago

Hi @AMollis. Thank you for your reply! I used custom shader in this tutorial: https://www.youtube.com/watch?v=LMqio9NsqmM, I want to implement a mesh outline effect which is good to use. As for Mixed Reality Graphic Tools, I've tried it, but the effect is nor good enough. You can look through this issue: https://github.com/microsoft/MixedReality-GraphicsTools-Unity/issues/209

AMollis commented 6 months ago

@Hanning-Liu thank you for the issue you've reported. Unfortunately, this is not a bug in the MRTK3.

The issue is likely with your custom sharer. It's likely your OpenXR project is setup with Single Pass instance rendering.

Image

You can attempt to switch to "Mutli-pass" to confirm. However, it's highly recommended to use "single pass instancing" for the best performance. In which case you need to update your shader to support "single-pass instance". If you have further questions, please post in the discussion forum.