I’m trying to displace vertices of a skinned mesh (one bone per vertex). I was able to move its vertices by setting the CFrame of each bone, but its normals still point upward. I calculated the correct normals for each vertex, and tried setting the normal by setting the bone CFrame like this:
--normal and bitangent switch places because bones all point upwards
bone.CFrame = CFrame.fromMatrix(position, tangent, normal, bitangent)
This doesn’t look quite right - there are no specular highlights, though I can see them before the mesh is displaced.
Is there a correct method of setting normals for a skinned mesh bone?
The CFrame math looks right. and I’m pretty sure the code for normal calculation is correct (calculating normals for gerstner waves - based on this)