On the client. A WebGL shader that ray traces each pixel towards the sun. If the ray hits terrain on the way, the pixel will be in the shade.
It also takes into account the Earth's curvature, so you can zoom out to planet level and it still works.
It also takes into account the Earth's curvature, so you can zoom out to planet level and it still works.
By the way, you might like https://felixpalmer.github.io/volcanoes-of-japan/
Great link, thanks. Horizontal scrollbar tripped me out a little bit though...