Robust Earth Shader

https://jsfiddle.net/mars91/qd659xpw/8/

Here is a 3D Earth class, called Earth3D, with multiple options (methods) to use inside the animate function. The shader requires the Earth’s position, camera position, and Sun position, so depending on where you place the Earth and how it’s rotating, hopefully, one of these methods work!