I have a plane that has many vertices. I have been playing around with a script that deforms the plane by moving the verts up and down (terrain) on run time to deform the plane.

I was wondering if it’s possible to change the assigned material’s color or transparency by each vertice by its height in run time? With the plane’s Y 0 being neutral and transparent or particle/multiply. Then a vertices deviance would add +3 = white -3 = black etc. (imagine snowy peaks and dark troughs.)

You can tune a lot of parameters including center height, variance, colors at extremes and also apply a general texture. This shader also interacts with lights.

Not sure how to do this with a shader, but you could probably do this with a simple gradient and some UV operations. (each vertex would get an arbitrary U coordinate, the V coordinate would be the height, normalized, so it is between 0 and 1)