Normals and Tangents after Vertices rotate / scale / translate

I have a scenario where I need to deform part of the model and translate / rotate / scale some of the vertices.

If you mean you have a model of say a person with a arm that moves but that arm doesn’t deform.
E.G. like the hand doesn’t grow a sixth finger or anything then that’s just a rigged animated mesh you don’t have to recalculate normals or tangents for that. If the whole model scales uniformly the same thing.

If however the arm grows lumps or the hand has a animation that grows a extra finger that is a deformation these typically require a completely different set of animations and matrices and then you need to recalculate the vertices or have extra mesh data for the full extent of the deformation to perform a interpolation without it being computationally super expensive or have a separate set of bind pose matrices as well for this in addition to the animation matrices and bind poses or them.

If your problem is the first case and you are having trouble with lighting then it is likely that…

You are applying the matrix as is to the normals and tangents which instead you should only apply the 3x3 non translational part of the matrix against the normal. That only contains the (proportionally equal axis xyz) scaling and rotation. You then afterwards should re-Normalize the normal and tangent all done on the shader sometimes its enough to just do the normalization.

Normals and Tangents are purely directional vectors of unit length which is all that is requisite for lighting calculations. Performing the same transformation of scaling translation on them that is applied to the positional part of the vertice will make them non unit length and mess up lighting calculation hence yanking out or zeroing out the 3x3 portion of the transformational matrice to be used on the normal and tangent separately in your shader.

A bind pose matrix undoes scaling translation and rotation from the previous nodes which is not to say that even when used scaling if non uniformed can again even in the above scenario throw off light calculations so idealy you re-normalize the matrix however thats more expensive, bit harder to explain and not needed in 99% of the cases (other then the normal bind pose model calculation) as typically morphed meshes are primarily vertice translational based not done with scaling and a renormalization of the result is simpler.

Here are some of my shaders when just working with the prior animated meshes because i was using bones and inverse bind pose matrices i don’t actually use the 3x3 though really i should.

This project also has a example of drawing the normals to be visualized when you hit f6.
Far from done but… maybe it helps to look at how the normals are handled tangents would be the same i didn’t get around to adding them yet.