From cbcc2bdff717fe0d42389daa576f151bc75a7c44 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Wed, 8 Feb 2023 10:52:32 -0800 Subject: [PATCH] solve issue #1879 (compile-time error in Skinning.glsllib) --- .../src/main/resources/Common/ShaderLib/Skinning.glsllib | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jme3-core/src/main/resources/Common/ShaderLib/Skinning.glsllib b/jme3-core/src/main/resources/Common/ShaderLib/Skinning.glsllib index 293879159e..0e0696c7a3 100644 --- a/jme3-core/src/main/resources/Common/ShaderLib/Skinning.glsllib +++ b/jme3-core/src/main/resources/Common/ShaderLib/Skinning.glsllib @@ -50,10 +50,12 @@ void Skinning_Compute(inout vec4 position, inout vec3 normal, inout vec3 tangent if (inHWBoneWeight.x != 0.0) { #if NUM_WEIGHTS_PER_VERT == 1 position = m_BoneMatrices[int(inHWBoneIndex.x)] * position; - tangent = m_BoneMatrices[int(inHWBoneIndex.x)] * tangent; - normal = (mat3(m_BoneMatrices[int(inHWBoneIndex.x)][0].xyz, + + mat3 rotMat = mat3(m_BoneMatrices[int(inHWBoneIndex.x)][0].xyz, m_BoneMatrices[int(inHWBoneIndex.x)][1].xyz, - m_BoneMatrices[int(inHWBoneIndex.x)][2].xyz) * normal); + m_BoneMatrices[int(inHWBoneIndex.x)][2].xyz); + tangent = rotMat * tangent; + normal = rotMat * normal; #else mat4 mat = mat4(0.0); mat += m_BoneMatrices[int(inHWBoneIndex.x)] * inHWBoneWeight.x;