@lisyarus https://github.com/sketchpunklabs/ossos/blob/ossos_next/prototypes/_lib/customSkinning/MatrixSkinMaterial.js#L59
Here's an alternative example of doing matrix skinning in glsl. This way you can remove the loop in your shader & get the final model space transform for the bone that you can apply to the pos & normal, instead of computing it twice.
In that folder I also have Pure DualQuat, Transform > DQ+Scale and SQT skinning alternatives.
@sketchpunk Well the loop will be unrolled by the compiler anyway, it's here just for convenience. As to computing the total matrix first and then applying it to position and normal - I thought about it but decided that it's more arithmetic operations this way. But now that I think about it I realize I might be wrong :)