[vulkan] Use identity for vertices with no bone weights

Since the identity matrix is mixed in with the other bones, interesting
things will happen if the bone weights don't add up to 1 and are not all
zero.
This commit is contained in:
Bill Currie 2023-09-04 11:08:55 +09:00
parent 8dd0410968
commit 084ac76f55

View file

@ -46,6 +46,7 @@ main (void)
m += bones[vbones.y] * vweights.y;
m += bones[vbones.z] * vweights.z;
m += bones[vbones.w] * vweights.w;
m += mat3x4(1,0,0,0,0,1,0,0,0,0,1,0) * (1 - dot(vweights, vec4(1,1,1,1)));
vec4 pos = Model * vec4 (vec4(vposition, 1) * m, 1);
if (IQMShadow) {
gl_Position = shadowView[MatrixBase + gl_ViewIndex] * pos;