How to apply biomes with Texture Splatting

Hi, I’m working with the terrain splatting and I want to add “biomes” to the terrain.

The idea is:

  • I have a terrain, generated with a HeightMap.
  • I have a StencilMap for the terrain, for example this:

Imgur

  • I have a “BiomeMap” like this:

Imgur

  • The black biome has 3 textures asociated:
    • R: One completely yellow
    • G: One orange
    • B: One Pink
  • The white biome has other 3 textures asociated:
    • R: One Purple
    • G: One Dark blue
    • B: One Light blue

I want the StencilMap choose and paint the texture into the terrain acording to the BiomeMap, resulting something like this:

Imgur

Do I have to cut the terrain in diferents geometries, one per biome, so each one has the textures of the current biome?

The idea is to have several biomes, more than 4 (with 3 textures per biome there will be more than the 12 textures admitted by the actual Texture Splatting).

The terrain shader doesn’t support this.
The best option you’d have is to make your own terrain shader that uses your stencil map.