fix normals with shape key and skin

This commit is contained in:
QuantumCoderQC 2021-10-27 19:51:13 +02:00
parent 8df6fc9176
commit 669898fae1
1 changed files with 1 additions and 1 deletions

View File

@ -25,6 +25,6 @@ def skin_pos(vert):
def skin_nor(vert, is_morph, prep):
rpdat = arm.utils.get_rp()
if(is_morph):
vert.write_attrib(prep + 'wnormal = normalize(N * morphNor + 2.0 * cross(skinA.xyz, cross(skinA.xyz, morphNor) + skinA.w * morphNor)));')
vert.write_attrib(prep + 'wnormal = normalize(N * (morphNor + 2.0 * cross(skinA.xyz, cross(skinA.xyz, morphNor) + skinA.w * morphNor)));')
else:
vert.write_attrib(prep + 'wnormal = normalize(N * (vec3(nor.xy, pos.w) + 2.0 * cross(skinA.xyz, cross(skinA.xyz, vec3(nor.xy, pos.w)) + skinA.w * vec3(nor.xy, pos.w))));')