I created the animation with the sun position add-on. Then I changed the color of the background from a simple color to Sky Texture in World Properties, setting up the sky environment. In my composition I changed my light to sun. In the sun position tab I selected my sun as the sun object and added a sky texture to the sky texture. I entered some world coordinates, to change the sun position and to simulate the sun movement in that region. Then I added a date and set it to June.
To animate the time, I went to frame one, set the time value to zero, and created a keyframe. Moving to the last frame, I set the time to 23.999 (essentially midnight), and created another keyframe.
To transition between day and night, I blended two sky textures. First, I duplicated the Sky Texture node and renamed them „Day“ and „Night.“ I added a Mix Shader and connected both sky textures. To simulate night, I set the sun elevation and rotation for the night sky texture to match the day sky texture using drivers.
To make the night sky more realistic, I adjusted the sun size to a smaller value, to resemble stars rather than a moon. Then, I set the altitude value for the night texture to a very high number, making it look like a night sky.
For the final step, I added stars to the night sky. I added another Mix Shader before the night sky texture and plugged in an Emission Shader. I used a Noise Texture and a Color Ramp to control the emission, adjusting the Noise Texture settings to create a starry effect. By adding a Mapping and Texture Coordinate node, I ensured the stars rotated realistically as the Earth spins within the universe.
I also adjusted the color management to high contrast, especially during the night, making the scene look more vibrant. For the final settings, I adjusted the background strength for the night sky, giving a more intense moonlight effect, while keeping the sun intensity lower to soften the shadows.