day/night globe in cycles?

I am trying to figure out if it is possible to do this as a node setup in cycles.

What I would like to so is create a globe that is lit from a sun, and the shader uses the lighting as a mask to blend between 2 different textures. (Daytime earth in the lit areas, nighttime earth in the shadows.)

I know how to do this in Blender internal, but I don’t see a way to make the nodes work like this.

Anyone?

Have the same Problem…

mix node, fac input to dot product between normal and light (or just some vector) sign ?

Thought I would bump this once in case anyone had a solution yet.

storm_st - is there a way to get the location of the light from within the shader? I can get this technique to work somewhat, but the vectors to the light would need to be manually entered, and a new node for each light source in the scene. (unless I’m missing something.) Here is what I am using for a node setup now.