How to make the material apply to the cell terrain?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By BorisJohnson

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
Now I use RGB texture, but I’m not happy with it

Do you need to blend between materials?

SIsilicon | 2018-12-10 03:00

Yes. But materials should be very many

BorisJohnson | 2018-12-10 04:11

Well then.
You can’t really blend between materials on one geometry. That’s not even how opengl works. Instead you would need to have one shader that can have different appearances depending on a texture map like yours. Even though you have only 4 channels in a texture to work with, no one’s stopping you from using another 4 in a different texture.

SIsilicon | 2018-12-11 13:22