Skip to content

Commit ff4afc8

Browse files
author
Max Palmer
committed
Updated GenericHand shader to normalise normals to prevent outline scaling issues with hand rigs that don't normalize the normal vector
1 parent cdcb109 commit ff4afc8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Packages/Tracking/Hands/Runtime/Shaders/BiRP and URP/GenericHandShader.shader

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@
349349

350350
#if _USEOUTLINE_ON
351351
float3 norm = mul((float3x3)UNITY_MATRIX_IT_MV, v.normal);
352-
float2 offset = TransformViewToProjection(norm.xy);
352+
// Some hand models may include non normalized (length) normals
353+
float3 normalizedVector = normalize(norm);
354+
float2 offset = TransformViewToProjection(normalizedVector.xy);
353355
o.pos.xy += offset * _Outline;
354356
#endif
355357

0 commit comments

Comments
 (0)