Create mask for half of sphere I'm trying to create a rotatable mask for a sphere which I can rotate around the sphere using the mapping node. My aim is to make it look as though the sphere has a bright light shining on it (like the moon with the sun).

I have a mask which looks ok, but I'm not sure how to rotate it around the sphere with the mapping node. When I rotate it, the mask gets distorted.

Here is what I have so far:
Use the Object output of Texture Coordinate instead.   

I've also applied a 0.5 offset on the X axis position so the shadow edge is centered on the sphere(this is equal to the value of the position of the 'black' color on the ColorRamp).
It'll now scale correctly when rotated around any axis, since it's reference is centered on the object. 

If you want a softer or harder transition, change the position of the 'black' point on the ColorRamp - make sure not to forget to change the offset on the Mapping node as well.