From 563b5e3711cf1fac756640bc42b3a10a737d2e5a Mon Sep 17 00:00:00 2001 From: 0b5vr <0b5vr@0b5vr.com> Date: Tue, 4 Oct 2022 18:23:37 +0900 Subject: [PATCH] fix: Fix mtoon uv rotation direction The rotation direction is in which rotates UV coordinates counter-clockwise (in U-right, V-down space) Ref: https://github.com/KhronosGroup/glTF/pull/1624 --- packages/three-vrm-materials-mtoon/src/shaders/mtoon.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/three-vrm-materials-mtoon/src/shaders/mtoon.frag b/packages/three-vrm-materials-mtoon/src/shaders/mtoon.frag index e551880aa..e31f75512 100644 --- a/packages/three-vrm-materials-mtoon/src/shaders/mtoon.frag +++ b/packages/three-vrm-materials-mtoon/src/shaders/mtoon.frag @@ -331,7 +331,7 @@ void main() { uv = uv + vec2( uvAnimationScrollXOffset, uvAnimationScrollYOffset ) * uvAnimMask; float uvRotCos = cos( uvAnimationRotationPhase * uvAnimMask ); float uvRotSin = sin( uvAnimationRotationPhase * uvAnimMask ); - uv = mat2( uvRotCos, uvRotSin, -uvRotSin, uvRotCos ) * ( uv - 0.5 ) + 0.5; + uv = mat2( uvRotCos, -uvRotSin, uvRotSin, uvRotCos ) * ( uv - 0.5 ) + 0.5; #endif #ifdef DEBUG_UV