Skip to content

Mjp/make outline hands outline independent of normal scale #1690

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Packages/Tracking/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Text on the toggle button in the UI Input example scene now shows On or Off based on the toggled state
- Clients were not able to subscribe to the events on the PinchDetector and GrabDetector scripts as the properties were exposed as readonly.
- GrabDetector detection logic was inverted, so open hands were interpreted as grabs. Now fixed.
- Fixed issue with scale of outline in GenericHandShader if hand model normals are not a normalized length

### Known Issues
- Pose detection scene does not illuminate all poses in green if built for mobile headsets when using URP (2022.3), spotlights don't work as intended on Unity 6.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Shader "Ultraleap/GenericHandShader"
Shader "Ultraleap/GenericHandShader"
{
Properties
{
Expand Down Expand Up @@ -349,7 +349,9 @@

#if _USEOUTLINE_ON
float3 norm = mul((float3x3)UNITY_MATRIX_IT_MV, v.normal);
float2 offset = TransformViewToProjection(norm.xy);
// Some hand models may include non normalized (length) normals, so we normalize the length of the normal first
float3 normalizedVector = normalize(norm);
float2 offset = TransformViewToProjection(normalizedVector.xy);
o.pos.xy += offset * _Outline;
#endif

Expand Down