Best way to change point/path color when in globe shadow cone

Context: Showing satellites as points orbiting around the earth

Problematic: I would like to change the color of point and path of an entity when it’s entering/leaving the shadow cone of the globe.

Current ideas:

  • Using sampled color properties where the color is different if the entity is behind the globe. The computation of this boolean would be done through a formula using the entity position and the date.
  • Using a material color where the shadowing system is used to compute the shadowed color, however I’m not sure how to implement this. If you can refer me to an example of using a material color for a point or any non 3D primitive it would be great.

I surely omitted other ideas to do this as I’m new to CesiumJS. Please feel free to suggest any other way that seems relevant to you.

By the way a huge thank you for your great work on CesiumJS, the project is really complete and it’s nice to have such tools open sourced!