Working on some procedural materials and wondering if there's some way to get a sense of how much an area has been compressed or stretched from some resting position. Ideally this would be a vector value with direction of stretch.
I know there's the UV Stretch stretch feature in the UV editor as described here: Is there a way to show distribution of UVs as a heat map?
If there is some way to get these value into cycles I imagine it might be possible to calculate a vector stretch value for a neutral version of the model then subtract it from one for the deformed model.
My second thought is there may be some way to do this with OSL, but I've never dabbled into it before.
I'm currently digging into the Blender API and OSL to see if I can make my own script node for this, but I thought I'd ask the question here before I waste a bunch of time only to find out there's an easier way to do this.