I'm doing a procedurally generated terrain and can't figure out how to implement a single cell material assignment. By cell I mean the two triangles of the mesh. The use of RGBA textures for material separation greatly limits the amount of materials available. I think I need something like a Material Array or Texture Atlas. I need something that I can say - this cell by Vector (1, 1) is "grass", and this Vector (2, 2) is "brick", and this Vector(3, 3) is " cobble". How to do it?

Now I use RGB texture, but I'm not happy with it