Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line pointer refactor for performance #6863

Conversation

Troy-Ferrell
Copy link
Contributor

@Troy-Ferrell Troy-Ferrell commented Dec 11, 2019

Overview

Change notes
This change refactors the default hand ray pointer prefabs and classes for more optimal performance. Key impacts

  • LinePointer class has been simplified to only support raycast along a 2-point line (one raystep). Support for multi-raystep has been pushed down to a new inherited class, CurvePointer. Teleport pointers now inherit from this class. Simplifying LinePointer reduces some overhead in calculating points along the curve and number of raysteps involved.

  • The ShellHandRayPointer has been re-worked to alternate the line renderers material instead of doing weird things using two MixedRealityLineRenderer components. The dual render components were weirdly setup and doing duplicated work to the unity LineRender. If the old line renderer properties are used, a warning is logged during start alerting user to switch to new property

  • DefaultControllerPointer prefab has removed the dual MRLineRenderers in favor of one. Also LineStepCount on the MRLineRenderer left is lowered from 16 to 10.

  • Fixed line renderer issues (did not respond to FadeLineOnEnable toggle, gradient value setting and material tiling)

Breaking changes

  • ShellHandRayPointer has been removed of it's MRLineRenderer properties (lineRendererSelected and lineRendererNoTarget)
  • IMixedRealityPointer now requires a Reset() method in it's interface

Updated #6922 for migration in properties change on ShellHandRayPointer

Added test under PointerTest.cs to confirm line pointer raycasts straight and curve pointer works with teleport pointer collisions

BEFORE
image

AFTER
image

Changes

Verification

Tested
HandsInteractionExampleScene in editor
HandsInteractionExampleScene VR on Device
Teleport system VR on Device
ExamplesHub app on HL2 device (IN PROGRESS)

As a reviewer, it is possible to check out this change locally by using the following
commands (substituting {PR_ID} with the ID of this pull request):

git fetch origin pull/{PR_ID}/head:name_of_local_branch

git checkout name_of_local_branch

@Troy-Ferrell

This comment has been minimized.

@Troy-Ferrell Troy-Ferrell marked this pull request as ready for review December 12, 2019 19:55
@Troy-Ferrell
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Troy-Ferrell
Copy link
Contributor Author

mrtk_docs fix on way

@thalbern
Copy link
Contributor

@davidkline-ms

        David Kline (ANALOG)
        FTE how do we mark PRs that needs to have notes added to the next release notes cycle? etc

Ping @wiwei Will Wei FTE to provide guidance on this while David is out.

Normally we have an issue to track breaking changes for a release, but it might not have been created for 2.3 yet. For example: #5912

I've added a ticket for tracking the 2.3 breaking changes: #6922

Copy link
Contributor

@keveleigh keveleigh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Pending the TODOs in your PR description.

Troy-Ferrell and others added 4 commits January 2, 2020 10:38
…ellHandRayPointer.cs

Co-Authored-By: Kurtis <kurtie@microsoft.com>
…hub.com/Troy-Ferrell/MixedRealityToolkit-Unity into users/trferrel/line-pointer-refactor-v2

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@keveleigh
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Troy-Ferrell
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Troy-Ferrell
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@david-c-kline
Copy link

@Troy-Ferrell, this looks to be blocked by a merge conflict and a test failure (related?)

…ctor-v2

# Conflicts:
#	Assets/MixedRealityToolkit.Tests/PlayModeTests/PointerTests.cs
@Troy-Ferrell
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Troy-Ferrell Troy-Ferrell merged commit eee7a55 into microsoft:mrtk_development Jan 7, 2020
@Troy-Ferrell Troy-Ferrell deleted the users/trferrel/line-pointer-refactor-v2 branch January 22, 2020 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LinePointer is overly expensive
5 participants