I have height map, which you could think of as fairly smooth 'hills'. Given any point on the map, I need to find out what 'direction' the hill is sloping in, around 360 degrees as viewed from above. I've tried many things. I looked at bump-mapping tutorials and trying to calculate normals and arctangents and so on and I just can't seem to get it to work. Let's say you are standing on the top peak of a hill, the hill slopes 'away' from that peak in given directions, around 360 degrees. The let's say I want to paint the parts of hill that are "pointing" in a given direction, a certain color from a palette texture. So I'd end up with what perhaps can be described as how an umbrella looks when viewed from above. This is of course based on the angles of the slopes. So then depending on the height map, it should pull colors from a palette based on the general direction of the slope of the hill. I've tried with sampling x, x+1 and y+1 pixels and trying to get the normal by normalize(cross(xdiff,ydiff)) ... if that's even right. Then tried to convert that to an angle with arctangent2. But I can tell that this just isn't correct. Any help much appreciated, it should be fairly simple but I am having trouble getting the calculation right.