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

MRTK Standard Shader Reflections are the same for each eye (depth is wrong) on Android Oculus Quest #8207

Closed Fragilem17 closed 9 months ago

Fragilem17 commented 4 years ago

a PBR material using the MRTK Standard Shader with reflections enabled feels right in the Unity Editor (2019.4.4f) looking throught the Oculus Quest headset however shows that the reflections are being rendered from the same origin point for both eyes. This results in having no depth to the reflection and it looks really weird and wrong.

When previewing using Oculus Link (so running from the PC) the depth does look correct so it's something introduced when building the shaders for mobile (android).

To reproduce

Create a VR project for Oculus Quest using Unity 2019.4.4f, Single pass, forward rendering, NO URP Create a highly reflective MRTK Standard Shader material with or without a channel map. Create a scene where you have something to reflect of and attach the material. Build for the Quest and run on device. Move around the scene and look at the reflection. It feels like something is moving on top of the material instead of a clear reflection both eyes are seeing the same reflecting image and the illusion of reflection is gone. Close one eye and move sideways and you'll see the reflections feels okay again.

Expected behavior

a reflection that looks different for each eye

Screenshots

Very hard to take a screenshot explaining the problem as the quest only allows me to screenshot one eye.

Setup

Target platform

Fragilem17 commented 4 years ago

Fixed it by adding this to the shader: Starting on line 987:

if defined(_NORMAL) || defined(_REFLECTIONS) || defined(_ENVIRONMENT_COLORING)

            UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);

endif

wiwei commented 4 years ago

@Fragilem17 if you are comfortable sending out a PR for that, that would be awesome!

stale[bot] commented 3 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

Ayfel commented 3 years ago

Any news on this? Also not sure where to add the fix exactly that is mentioned above

P.S: Just add at the beginning of the fragment shader https://docs.unity3d.com/Manual/Android-SinglePassStereoRendering.html

stale[bot] commented 2 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

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 visithttps://www.mixedrealitytoolkit.org.

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