Hillshade from a heightmap

Hillshade is the dot product of the surface normal with a light direction. A sun at 315 degrees azimuth and 45 degrees altitude is the cartographic convention, even though the real sun never shines from the north-west in the northern hemisphere.