# Night cycle on a globe

I am working on a tile based game on a globe. I am trying to implement a simple day night cycle on my hex globe something similar to the image below

Here is the picture of my globe inside Unity

I am just using a few point lights but it doesn't look perfect. Would it be possible to do better with the current lighting system in Unity or do I have to just play around with different lights, intensity and their positions to make it look close to what I want. Also is there any way through a script that I can get information on if my gameobjects in the scene are being lit by a source of light. I would want this to get information on the tiles that are in the dark and the ones that are in the light

• Wouldn't the sun be better approximated with a Directional Light? Commented Sep 30, 2014 at 23:33
• Yea it would but I want one half of my globe to be in the dark and the other half lit. With the directional light wouldn't it always lit the entire globe? Commented Sep 30, 2014 at 23:50
• @JimZilla you are thinking of ambient light, directional will always come from the same side and light half of a sphere Commented Oct 1, 2014 at 11:00
• cool I get it now Commented Oct 2, 2014 at 19:28

Unity has three kinds of lights that work in real-time: Directional, point, and spot.

Point lights just sit somewhere and emit light in all directions, which sounds a lot like the sun, but you would have to put the light so far away from everything and make it so strong that it may be unreasonable.

Spot lights are the same, except they emit light in a cone instead of in all directions.

Directional lights, however, don't have a position. Well technically in Unity they probably do, but the position isn't used in the light calculations. The only factors are the direction and the strength of the light. This means the light effectively has a distance of infinity, but the brightness does not fall off.

Of these three, the directional light is the most reasonable to simulate sunlight, even if it doesn't exactly sound right.

For some pictures to further clarify things, here's Unity's page on the matter: http://docs.unity3d.com/Manual/class-Light.html

• I understand that directional lights work best for sun light but in my case, I want half of my globe to be lit and the other half to be in complete dark and not have any possible light thrown. This is to imitate a day night cycle as seen from outer space. With directional lights, they would light the entire globe which is not what I want which is why I tried using multiple point lights and light only half of the globe but that doesn't work quite well. Commented Sep 30, 2014 at 23:58
• No they wouldn't. All light types will only light faces pointing toward them. (Unless Unity has subsurface scattering or something...but I'm not aware of that.) An ambient light would light all faces regardless of direction, but that's a render setting, not an actual type for the Light class. Commented Oct 1, 2014 at 0:03
• Thanks, I will try that out. Hopefully it should work. Also I still have one question. Is it possible to get information on whether my gameobjects in Unity are lit by any kind of light? I would want this information to group my gameobjects as the ones that are lit and the ones that are in the dark Commented Oct 2, 2014 at 19:31
• You should make a new question for that. It might be easier to just keep track of where they are on the planet relative to its rotation, but I'm not really sure. If you make a new question you might get much better answers. Commented Oct 2, 2014 at 19:41