I’m looking for something that will color a mesh depending on the height of each spot on the mesh, a “topo map” kind of thing. I am NOT looking for something to produce an actual 2D topo map from a mesh, but something to color the mesh in 3D.
I am not shader-savvy enough to figure out the exact code, but it seems like in the pixel shader I need to get the world Y of that point and derive the color from that. Am I on the right track? How do I get that Y value?
That does work somewhat, by fooling around with texture scaling, but I found a tradeoff on texture size when trying to put in the topo lines in the pre-made texture. They tend to get too chunky on low slopes or almost invisible. I think this might require some greater logic to take care of that.
So to get the world Y value of a mesh pixel in the shader, how would I obtain that? Thanks!