Shader for drawing borders from texture?

I have a terrain mesh I want to draw borders on. Something like this is the effect I am after:

I have created a border texture like this:

Which I thought I would use in a surface shader to draw the borders. The problem is that it becomes very pixelated and thin…
So instead I thought that maybe I have to calculate a “Border Proximity” for each vertex which I can then use in the shader to get a smooth border gradient, but that sounds quite expensive to calculate for large maps…

Maybe my approach is totally wrong and there is a better way to achieve this… I was wondering if anybody has any ideas here :slight_smile:

Thanks

Hi and welcome.
Couldn’t you generate a blurred version of the map outline and then use that gradient to render a border of desired thickness and smoothness. This would essentially be a distance field and proximity of the border.