Displaying biomes on a procedurally generated mesh quad by quad

Godot Version

4.5.1

Question

I’ve got a mesh that is being created at runtime. It’s not generated, it’s stored and is loaded from files by chunks of 100x100 tiles. Each tile has a biome. Those are not controlled by elevation, only by tile info.
Each biome should look differently for the player on the terrain. How do I show those on a per tile basis?

I’m talking about the ability to show 50 or so different biomes. At first I thought I’ll be able to load those into a shader(not sure yet if it’s possible) or create a big texture with lots of biomes and pointing UVs at the right one. But for both of those UVs need to be separated for each tile, which seems to be impossible to do at mesh creation.
The only solution I came up with so far are separate decals for each tile. But it’s gonna be 90k decals in the scene all the time, that doesn’t sound like a proper solution.
I could create each quad separated from the rest but it will increased vertices significantly and I’m not sure it will behave properly with light and reflections.

Why would that be impossible?

That many decals won’t fly. Either UVs or a biome index texture.

I’m not seeing any methods to have multiple uv coords for vertices in surfacetool. There is set_uv2(), but most vertices will need 4 different uv sets.
Will look into biome index texture, thanks!

No need for multiple uv coords. Have multiple vertices instead.

Not sure a “Biome index texture” is a thing as I just invented the term. Maybe it is. The principle is simple, pass a texture to a shader in which a pixel value represents a biome index. Use this index to access a proper layer in a layered texture that contains all biome textures, each at a separate layer.