Tutorial: Dynamic Earth Day to Night in Cycles

You’ve already seen plenty of planet modeling/texturing tutorials, but have you ever tried to have it transition from day to night?
To create a dynamic day to night transition for Earth or any other planet in Cycles, we’ll need to get the rotation data of the sun and plug that into the normal value of the sphere.
We can do this pretty easily by adding drivers to a mapping node between the input geometry node and the normal node.

That’s good timing, fits nicely with the earth tutorial that blenderguru just put up.
http://www.blenderguru.com/tutorials/earth-cycles/