Lightning setup problem for a planet with day cycles - what approach should I take?


So this is the planet. Its made from 3d objects and doesnt use landscape. You can rotate the camera all around it, and zoom in and out freely. It should block the lights behind the planet during day/night cycles.

If I zoom in a lot to demonstrate how light goes “through” it, it looks like this. The buildings and foliage are catching blue light they shouldnt now. The light comes from directional source, and thus is not “behind” the planet in reality, so the objects just catch light from that direction.

If I toggle the shadows on to all the lights, the blue will be blocked, since now the globe is in the way of the objects, and these wont be receiving light anymore, being in its shadow.

But as said, doing that will cause shadows to go from east to west multiple times a day, when they should only do so once.

As you said that performance with 4 lights is bad, are directional lights (without shadows) really that expensive? Ive found dynamical point lights with large radius and shadows being the expensive light source, not directional ones without shadows?

“Another more expensive (performance with 4 lights and dynamic is already bad) solution that costs way less in time would be to set a sphere inside the planet that blocks the lights from getting through to the buildings.”

I am kind of already trying that, as the sphere that blocks light should be the water layer of the planet, but since the directional light doesnt cast shadows, well, the sphere/planet will not block anything. The directional light is not really behind the planet, as it just casts light to desired direction and doesnt take position of itself into account.