From e57d33966080a16ffa784dea6030872cc970c371 Mon Sep 17 00:00:00 2001 From: Rinnegatamante Date: Fri, 23 Oct 2020 20:01:52 +0200 Subject: [PATCH] Fix for skin animations not working. --- src/gl/shaders/skin_gl3.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gl/shaders/skin_gl3.inc b/src/gl/shaders/skin_gl3.inc index c8a2038..f2c50c5 100644 --- a/src/gl/shaders/skin_gl3.inc +++ b/src/gl/shaders/skin_gl3.inc @@ -21,10 +21,10 @@ const char *skin_vert_src = " fixed out v_fog : FOG,\n" " float4 out gl_Position : POSITION\n" ") {\n" -" float4x4 Skin = u_boneMatrices[(int)in_indices.x] * in_weights.x\n" -" + u_boneMatrices[(int)in_indices.y] * in_weights.y\n" -" + u_boneMatrices[(int)in_indices.z] * in_weights.z\n" -" + u_boneMatrices[(int)in_indices.w] * in_weights.w;\n" +" float4x4 Skin = u_boneMatrices[(int)(in_indices.x * 255)] * in_weights.x\n" +" + u_boneMatrices[(int)(in_indices.y * 255)] * in_weights.y\n" +" + u_boneMatrices[(int)(in_indices.z * 255)] * in_weights.z\n" +" + u_boneMatrices[(int)(in_indices.w * 255)] * in_weights.w;\n" " \n" " float3 SkinVertex = (mul(float4(in_pos, 1.f), Skin)).xyz;\n" " float3 SkinNormal = (mul(float4(in_normal, 0.f), Skin)).xyz;\n"