Hello everyone,
I generate meshes for my terrain, which combine two textures: one for the terrain type and one for the road network (when there is a road). The road network will evolve during the game (not each frame obviously, but from time to time) and I was thinking of the best way to implement that.
Here is what I plan to do : I could subdivide my tile map in areas of 10 x 10 or 20 x 20 tiles and generate a mesh for each area. Then, when I change the road network, I have to check which areas are concerned, get the corrisponding UVs arrays, modify the UVs values of the specific tiles and then reset the concerned mesh(es) UVs. With the tile coordinate, I should be able to get the correct index in the UVs array, so it shouldn’t be so long. Thanks to the subdivisions, I don’t have to reset the UVs of the whole terrain (the map is 200 * 200 tiles and could be bigger in the end, around 256 * 256).
If I go that way, what do you think would be the optimal size of the areas ? At the start, road network is around 10 % of the total of tiles ; at the end, probably around 20%.
Is there a better way to do that ?
Thans for your help !