Can i add layer on the dark side of the earth

Thank you very much for Cesium!!!

I read tutorial( and
added layer with city lights.
And put viewer.scene.globe.enableLighting = true;

Now I want to show layer with city lights only on the dark side of the earth.

Is it possible? And how can I do it?
Can I add layer only on shadow?
Or may be I can get coordinates of shadow and show layer on this coordinates only?

Thanks cesium team.

anybody have any ideas?

You want the shadow and city lights to move over time? Only thing I
can think of is rendering 6-12 versions of the city lights tileset with
transparency for the day/night boundary, and layering those over your
base (day side) tileset. You probably don't even want the shadow
effect turned on, as it will make the city lights completely dark.

You might get away with as few as 6 renderings if you have a soft
shadow edge and can layer then like:

time+4 hours: 20% opacity
time+0 hours: 100% opacity
time-4 hours: 20% opacity
base layer: 100% opacity

by progressively increasing (and decreasing, for the trailing edge) the
opacity of the past and future city lights layers, you could avoid to
much jerkiness in the movement of the night/day boundary.

But... that requires at least 6 sets of the city light tileset with
alpha transparency burned in and viewing four tilesets at once,
resource hungry. At least you could link the files that were identical
across periods to save disk space.

Cheers -Terry


Nice idea, Terry! I can’t vouch for that technique without having tried it, but a creative workaround is unfortunately the way to go here.

I can’t think of any easy out of the box solution for this one – doing what you suggest with different imagery based on sun position would probably involve modifying shaders.


  • Rachel