I am trying to figure out how to handling directional lighting for aircraft at altitude.
I have two directional lights, the sun and the moon.
The position of each is calculated from time, date, latitude, and longitude.
These get converted to directions and added into the lighting system.
My problem is that when they go below the horizon, they are still illuminating the objects.
So I need to handle the fact that the earth is blocking the light from these objects, but I need to account for the altitude of the aircraft as an aircraft at 30,000 feet will be illuminated for longer than one at 3,000 feet.
Anyone come across a solution for this?