I am trying to verify that if I have my inNormal
and some N
amount of morph normals that I would want to do something such as
outNormal = vec3(inNormal);
outNormal += morphNormal0 * morphWeight0;
outNormal += morphNormal1 * morphWeight1;
...
outNormal += morphNormalN * morphWeightN;
This seems to work for me (don't have a ground truth to compare) so I wanted to test it in Three.js knowing it would have an established method and I see they use
objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];
objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];
objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];
objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];
So now I am wondering how that math works out as it doesn't work for me. Both methods end up multiplying it by a normalMatrix
so not sure what would be different.
edit: Assuming both are loading in glTF 2.0 models