Tilemap - transitioning between tiles using layers and masks

Hi,
Quite new here and have recently started a projecting using Phaser3, just wondering if anyone would be willing to give advise on how best to achieve something. Not so much about the code but just what tools or methods are best.

So here’s the problem,
I have a huge randomly generated map that is currently using a tilemap. In the map are many materials that are plotted randomly and lets say there are 32 base materials.
So I want to be able to graphically transition these tiles, so they aren’t sharp squares but go from one material to another more naturally.
Normally people might use tile sets for this from what I understand, where a tile has the edges drawn.
As the map is random, any material could be next to any other material so drawing all those possible combinations would be time consuming.

So I was thinking that I maybe more time effective to generate these tile transitions using a method like so.
Firstly check the surrounding materials, create a new layer1 and set the first layer to the most popular material around the target tile. Add a mask that has transparent edges so layer1 is shown on the needed outer edges. Then add the target material to the center on another layer.
Hopefully that is understandable, not sure if is is a good approach?
If so then would it be easiest to create a dynamic tileset with these generated corner images and map that tile set. Or can this kind of operation be achieved during map creation using the tilemap layers and if so could those layers be merged once complete? Or something else?

Thanks for any advise that can be provided.
Regards

I think you would either use 2 tilemap layers with 2 tilesets (1 original, 1 generated) or else draw 1 tilemap layer plus edges onto a RenderTexture. But I don’t know how feasible a RenderTexture is for a large map, as you might end redrawing quite often.

Hi thanks for the reply,
It’s been a while since I’ve been able to get back to this.
I tried using layers but an issue I found is that I can’t always be sure that group 1 will be the primary base tile set.

I was looking at using a rendertexture but I’m not sure if I can use a rendertexture as a tilesheet and was wondering if I’d just be best computing the tilesheet on the server using something like imagemagik and forget about generating it on the client.