From e87c486545121eb6229d5c43033d92ba4379a13a Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Mon, 16 Mar 2015 18:13:23 +0100 Subject: [PATCH] Fix bone transformation of normals The binding pose had twice the influence on the final normal vectors that it should have had. Change the shader calcs so the weights end up correctly. --- planet/Graphics.ocg/ObjectDefaultVS.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planet/Graphics.ocg/ObjectDefaultVS.glsl b/planet/Graphics.ocg/ObjectDefaultVS.glsl index 4edfbfce3..3be85e949 100644 --- a/planet/Graphics.ocg/ObjectDefaultVS.glsl +++ b/planet/Graphics.ocg/ObjectDefaultVS.glsl @@ -50,7 +50,7 @@ slice(normal) normalDir = normalize(gl_NormalMatrix * gl_Normal); #else vec4 base_normal = vec4(gl_Normal, 0.0); - vec4 normal = base_normal; + vec4 normal = vec4(0, 0, 0, 0); normal = merge_bone(normal, base_normal, bones[int(oc_BoneIndices0.x)], oc_BoneWeights0.x); normal = merge_bone(normal, base_normal, bones[int(oc_BoneIndices0.y)], oc_BoneWeights0.y); normal = merge_bone(normal, base_normal, bones[int(oc_BoneIndices0.z)], oc_BoneWeights0.z);