Warp the matcap texture to accommodate changes in light direction

I’m someone who does stylized rendering projects and I find effects like hand-painted metal are hard to implement algorithmically, using MATCAP is more appropriate.
But the MATCAP doesn’t change depending on the angle of light, so I’m trying to stretch or compress the MATCAP depending on the direction of light to achieve better results.

A similar but much more complex implementation is found here