microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

After using the Asset Bundles browser, only the left eye can see the virtual object #11320

Closed shoukailiang closed 9 months ago

shoukailiang commented 1 year ago

Describe the bug

When I put a cube (standard shader) into hololens2, everything is normal. So I packed the cube into. ab and loaded it in hololens2. It becomes a monocular rendering. I don't quite understand. If the shader is a problem, why is the cube rendered by two eyes at the beginning? I also used the shader provided by mrtk. It is good under mrtk2.6.2+unity 2019, but there is a problem under unity2020.3 lts and mrtk 2.7.2: only monocular rendering.

Target platform (please complete the following information)

RogPodge commented 1 year ago

This may be a quirk with the asset bundle system, are you able to see the cube if you use a different shader?

shoukailiang commented 1 year ago

@RogPodge .Hello, all shaders are the same. I tried the shaders provided by MRTK . In addition ,when the. ab is loaded, it is monocular rendering (only one eye can see it). In the process of running the project, I modified the shader corresponding to this cube through code. At this time, everything is normal. But the magic is that the two shaders are the same. I'm not sure if I describe it correctly. My English is not very good.

keveleigh commented 1 year ago

@Cameron-Micka Do you know any quirks about using shaders from Asset Bundles that might be causing this monocular rendering?

Cameron-Micka commented 1 year ago

Asset bundles are a bit unique in that they package compiled shaders within the bundle. So, when you download an asset bundle materials within the bundle will use the shaders specified in the bundle rather than your project.

This is normally ideal behavior, but I've seen quirks where people generate asset bundles in a separate Unity project that has different project settings. If this happens you can run into issues where shaders within the bundle don't support all of the features your main project requires. For example, in Unity 2021+ if you create asset bundles in a project that doesn't have a XR module installed then the build process will strip all instances of XR shaders in your bundle. This will result in shaders which don't support single pass instanced rendering only being available and monocular rendering.

IssueSyncBot commented 9 months ago

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!