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

Raycast Rubber effect #5203

Closed Tabularas closed 4 years ago

Tabularas commented 5 years ago

Hello Folks,

We are currently producing some Training modules on Unity 2018.3.6f1 and are/where using Windows Mixed Reality toolkit v2.0.0-Beta 2.

We now wanted to upgrade to 2019.1.8f1 because of LWRP, ShaderGraph, VisualEffectsGraph, which would be very handy to create the upcoming modules.

Sadly, we found out that the current Version we were using from WMRT is not compatible with Unity 2019 so we had to upgrade to Version RC2.1. Sadly, this ment we had to rewrite our whole scripts.

My main question would be the Raycast(er) (if I’m naming it correctly). In the "old" beta 2.0 version it was a stiff ray that was coming out of the Gizmo but in the new RC2.1 version it has a new rubber band effect that’s not very effective. Because we need to drag and drop many objects in the scene/game, the feeling is somewhat flimsy and not very intuitive. It's like moving objects with a fishing rod.

Is there a way to change this behavior of the Raycast? Stiffen the raycast somehow?

It would be nice to add a variable of how stiffen the Raycast should be (e.g. 10 = hard, 1 = soft)

Thank you in advance

Beta 2.0 image

RC 2.1 image

wiwei commented 5 years ago

@Tabularas, to clarify a bit, is this describing the curving that happens on the line when you say, grab a thing, move it over to the right or left, how the line will curve and then eventually snap back to being straight? Or are you seeing things be permanently curved?

Tabularas commented 5 years ago

@wiwei It is not directly the curving which is disturbing me, it's more that if you drag an object (which we had to do a lot in our project) the object is lagging behind the raycast position that came out of the origin. So placing an object exactly is hard because you have to drag the object more so that it is moving to it's final position because of the lag. The curve from the Raycast is just showing the "lag". So it would be nice to change how fast/slow the object that you have selected will be dragged/moved from the raycast.

I hope I could clarify my problem better :)

Tabularas commented 5 years ago

@wiwei I don't know if I explained my problem good enough. If you grab an object in version v2.0.0-Beta 2 the object was directly moving with the raycast. No slow movement or curved Raycast because. The object was directly moving with the Raycast and the Raycast was just a straight line.

If you grab an object in Version RC2.1 the object has the impression kind of having now some weight to it. It is hard to move it sideways and even harder to move it towards you. It feels like handling a "fishing rod". It seems that in the current RC2.1 version all objects have some kind of weight to it when grabbet.

I'm uploading an GIF to visualize our problem better.

WMR v2.0.0-Beta 2 WMR_2 0 0_Beta_small

WMR RC2.1 WMR_RC2 1_small

wiwei commented 5 years ago

Ah, thanks for creating those clips! I'll need to do a little research here, but I think that this might be something you can do with some configuration.

If not, we should definitely make this an option for folks.

Tabularas commented 5 years ago

@Wiwei Thank you for your answer. I just checked with our collegue and he had an additional "problem" that if an object is too far away it is very hard to drag the object close to you. This is also visible in the below clip.

We searched on the ManipulationHandler script and it seems that the depth movement (towards you) is "just" working if you are close to an object.

wiwei commented 5 years ago

Alrighty, I got a chance to look into this one today - someone else on the team was actually hitting this a couple months back, but I don't think it was until today (with this video) that we had a good example of what was actually happening.

I just tried this out on the latest mrtk_development, and the issue doesn't repro for us anymore (i.e. other person tried out the same scenario that was exhibiting the issues you describe, and now the same repro steps weren't hitting that anymore.).

There is one thing to note - the bezier-curve based drag motion still exists (i.e. the pointer will still bend toward the object). Even if you did swap to perfectly straight lines (doing so is a bit complicated and I'll need to write docs on it, which involves editing the DefaultControllerPointer and removing the Bezier Line Data Provider and replacing it with a Simple Line Data Provider), you would still see some degree of lerping going on as the object is smoothed into its final location.

Assuming you're using the manipulation handler stuff here, you could disable that lerping stuff by unchecking this box:

image

I'm changing this to a doc bug to explain more about how the line pointers/renderers work - if you could help confirm that the latest doens't exhibit this issue for you, that would be extremely helpful

wiwei commented 5 years ago

@Tabularas meant to ping on the last response, lemme know!

Tabularas commented 5 years ago

@wiwei

I turned it off but the objects that are moved sideways and especially dragged from far away close to you are still lagging very much behind. :(

wiwei commented 5 years ago

@Tabularas, do you have a min repro that you can share out that exhibits this? We could take a closer look with that.

Tabularas commented 5 years ago

@wiwei how can I upload a testscene for this thread (890MB)??

wiwei commented 5 years ago

@Tabularas If you have a onedrive/google drive/dropbox link you can share (maybe something that explodes in 7 days so that you don't have to keep it around forever) that would work.

Is there maybe something simpler (i.e. create a scene with object at 5 meters, attach X script to it, run in VR) that you find also hits this issue? Could save the hassle of uploading more stuff than you want :)

Also, reading through the message above I didn't see the explicit call out, but did you try out latest mrtk_development? Or did you primarily try turning off that smoothing active box? The box itself is additive on top of everything else done in mrtk_development, so if you're still using one of the currently released versions I would expect that you'd hit the same behavior.

Tabularas commented 5 years ago

@wiwei I just uploaded a "light" version of our application on my Gdrive account.

https://drive.google.com/open?id=1KXwG6zDhUwvJ8ldBIz2NmvjJchuBT3B6 which was the fastest solution in that time :)

No we are currently just using the v2.0.0 RC2.1 Package for unity (https://github.com/microsoft/MixedRealityToolkit-Unity/releases). And i did primarily turn off the smoothing active box, but I still had that "fishing rod" effect.

flyingaudio commented 5 years ago

HandInteractionExamples shows the same issue, where you pull the trigger with the pointer on any draggable object, and they lag behind, never catch-up to where the controller is pointing. Very noticeable if you rotate your wrist. Add a cube to the screen, scale it down, add Manipulation Handler component, and it does the same thing. We abandoned development with it because of this issue, but we are revisiting it again. Unticking smoothing changed nothing. This is with version Mixed Reality Toolkit 2.0.0-RC2.1.

Someone on StackOverFlow said they believe it works with the latest branch. I haven't tested yet.

The Microsoft MR Cliff House pointer works just right imo, a little lag, but always ends up straight out from the controller.

flyingaudio commented 5 years ago

@Tabularas @wiwei I just tried the latest development build https://github.com/Microsoft/MixedRealityToolkit-Unity/tree/mrtk_development and Will, you are right, it "fixes"??? the problem.

1) Smoothing now works. It can be turned off and adjusted, but the line drawing seems to be low performance, the line can get jittery, depending how you move (this is on the lower/faster settings). 2) Pushing and pulling objects to and fro doesn't have enough distance change. Is there an adjustment for it?

You already have a gold standard; the pointer in the Cliff House is silky smooth (no jitter) and very responsive, and the push/pull curve/multiplier feels very good. It is finely tuned. Please make mrtk work the same. You are close.

Tabularas commented 5 years ago

@flyingaudio

Agreed. The cliff house demo works very good. You can even pull/push object from very far away. Even the feature to see the battery level on the back is great but not available in mrtk (controller also missing)

stale[bot] commented 4 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.

stale[bot] commented 4 years ago

This issue has been closed by an automated process because it is stale. If this is still an issue please add a new comment with more recent details and repro steps.