2D Tilemap using UV Coordinates with nice transition between different tiles?

I am making a top down 2D game that has procedural terrain, and am trying to make the transition between tiles look nice.

I had this working by generating an object for every tile. I would then add a child sprite for the base tile type. I would then add another set of child sprites depending on the neighbors. If a dirt tile was next to a grass tile, the dirt tile would have the base dirt sprite, and a transitional grass sprite that was basically halfway transparent. This system was really nice because I just had a to create a 6x4 texture atlas per terrain type. (liberated-pixel-cup/resources/assets/lpc_full_assets/base_assets/water.png at master · seveibar/liberated-pixel-cup · GitHub)

However I recently switched to using a single mesh, and altering the UV coordinates to show the generated terrain. This reallllly improved my performance, but seemingly harmed my flexibility.

I’ve been searching for a way to “map multiple sprites at a single location on a mesh” but haven’t found anything concrete. I’ve attempted using uv2, uv3 but that doesn’t seem to work either (came up all yellow, no sprites).

I don’t want to create some giant spritesheet that has every possible permutation of tile types being next to eachother.

The other idea i had was to create multiple stacked meshes, and paint the transitions on a mesh above the base terrain mesh. That’s going to really increase the vertices i am looping through though :confused:

Is there a standard way to handle this?

Well I figured out i can use mesh.uv2 if i set the Secondary Maps → Detail Albedo x2 texture to the same atlas, and then set UV Set dropdown to UV1.

UV1 = mesh.uv2

However, that’s still only 1 extra texture. Maybe I need to learn to write a custom shader for this?