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
6.01k stars 2.12k forks source link

Fingertip object effects (light, bounding box) not appearing anymore #11311

Closed edgar-rodrigo-santos closed 10 months ago

edgar-rodrigo-santos commented 1 year ago

Describe the bug

Regression: Objects with materials that use "Near Fade" and "Use Light" options not behaving correctly. This worked fine on Unity2019.4LTS + MRTK 2.4.0. It is NOT working on Unity2021.3LTS + MRTK 2.8.2.

To reproduce

  1. Open the HandInteractionExamples scene
  2. Move hand closer to the Coffee cup with a Bounding Box.

Expected behavior

Bounding box and light slowly appearing like this: 2022-12-20 13_01_26-Window

Current behavior

Nothing happens (unless the finger is colliding with the bounding box):

2022-12-20 13_13_13-Window

Your setup

Target platform

edgar-rodrigo-santos commented 1 year ago

Forgot to add that it looks somewhat similar to this old ticket: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/5962

Zee2 commented 1 year ago

@edgar-rodrigo-santos , are you using URP or SRP? Tagging @Cameron-Micka, even though this isn't technically MRGT.

edgar-rodrigo-santos commented 1 year ago

@edgar-rodrigo-santos , are you using URP or SRP? Tagging @Cameron-Micka, even though this isn't technically MRGT.

We're using the "standard" render pipeline, we didn't touch URP or anything else related to the scriptable render pipeline system.

Cameron-Micka commented 1 year ago

Nothing happens (unless the finger is colliding with the bounding box)

This is a good clue! I would look at the location of the ProximityLight component. It should be located near the finger tip. The ProximityLight is what "illuminates" the bounding box. If it's floating off in space (near the cursor?) that might explain this.

edgar-rodrigo-santos commented 1 year ago

I investigated a bit more.

@Cameron-Micka The ProximityLight is in the correct place but it is "disabled": image

If I manually enable it in the editor, it shows what would be expected: image

I debugged FingerCursor.cs and found out that the cause for this element to be de-activated is IsNearGrabbableObject() returning false (which ends up setting "showVisual" to false, which ends up calling UpdateVisuals with false).

I'm also noticing that the "ray" for the "far interaction" immediately appears as soon as we stop colliding with the bounding box (which was not the case before: the hand had to get pretty far away for the "far interaction ray" to appear).

Unfortunately I don't really have more time to troubleshoot where and how exactly this regression happened. Would you be able to fix this or provide a work-around, please?

Thank you

Cameron-Micka commented 1 year ago

Thank you for investigating @edgar-rodrigo-santos!

@Zee2 it's been awhile since I worked with the input system, does this ring any bells?

I debugged FingerCursor.cs and found out that the cause for this element to be de-activated is IsNearGrabbableObject() returning false (which ends up setting "showVisual" to false, which ends up calling UpdateVisuals with false).

I'm also noticing that the "ray" for the "far interaction" immediately appears as soon as we stop colliding with the bounding box (which was not the case before: the hand had to get pretty far away for the "far interaction ray" to appear).

RogPodge commented 1 year ago

We have a bit more context on why this issue is occuring. The light still works, it's the system that drives when the cursor appears has changed though. It's on our radar to ensure that this is addressed in future MRTK versions.

edgar-rodrigo-santos commented 1 year ago

@RogPodge based on my own investigation, that sounds right.

Do you think this fix will take a long time? In the meantime we are running apps on clients with this regression (it was no longer an option to stay in previous versions of mrtk2) and this affects user experience quite a bit (e.g. this also happens in buttons in our UIs which is a big deal as this feedback is quite important for buttons).

Thank you

cheles commented 1 year ago

@RogPodge thanks for confirming this . this is also tracked MS internally / support so let me know if you need more private info from @edgar-rodrigo-santos or myself.

IssueSyncBot commented 10 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!