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
Is there a standard way to handle this?