Shape-independent edge texture fade

Hello, I’m trying to make a mask that would fade one texture into another towards the edges somewhat independent of the objects shape, the expectation is to achieve something like the first image. Red lines are UV seams.

With the attached graph I managed to get the result in the third image, UV’s were laid out as in the last image, not at all to my liking.

This way would also force me to use world-aligned textures to combat the stretching of the bad unwrapping, and all kinds of issues further on.

How should I go about actually achieving my expected result in a proper way?
I would appreciate all the help I can get.

258621-expectation.png

258623-result.png

258624-uv.png

Your best bet would be doing it in pre-processing step in your content creation package by encoding distance to nearest edge into additional UV channel.

I don’t quite follow what you mean with encoding distance to nearest edge into UV, could you explain a bit further what that means?
I haven’t really stumbled across that during the time I’ve used Blender.