0

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?

OishikG
  • 69
  • 1
  • 6
  • Why not add the texture directly to the mesh? Converting to a height map seems like an unnecessary complication. – Nico Schertler Jul 20 '21 at 16:23
  • 2
    A little bit unclear what your underlying goal is .. I think the easiest would actually be to use a shader that colors the object based on vertex height in the world .. then you wouldn't need to care about a texture at all .. e.g. like [this one](https://answers.unity.com/questions/882134/shader-based-on-vertex-height.html) – derHugo Jul 20 '21 at 16:57

0 Answers0