So it got a little more involved than I was thinking but I finally managed to get it working. Posting my solution here in case it can help others.
The high level MF takes the displacement value, the size of the landscape tile in vertices and the desired size of the edge in percentage of the overall surface as inputs. It outputs the input displacement value if we are in the middle of the landscape, and 0 if we are near the edges.
We use the fmod operator to determine where we are along the current tile and then divide by tile size to normalize this value. The 4 material functions then just check if we are near zero or one:
I would have preferred to automatically detect the size of the landscape object, but everything I tried was returning information on the landscape components and not the overall landscape tile. Also note that this implementation assumes that the tiles are offset so that 0,0,0 in the world falls at a 4 way tile meeting point and that all tiles are the same size and scale. You should be able to use different X and Y scales for your tiles, but I’ve not tested this as it’s not part of my current use case.
Enjoy!


