I am using unity for a project where my algorithm procedurally generates different kinds of terrains.
The problem is that, I am trying to add colors by adding textures to my mesh. I know how to do it which is by making a simple Heightmap and then some if-else logic.
But I can't really figure out the algorithm I need to use to convert a mesh's vertex's y axis to a heightmap.
so, does anyone know the Algorithm's name?