Over the last few years, open world videogames have been gaining lots of interest in the gaming industry. Open world videogames not only allow the player to freely roam over a vast terrain but also aim to recreate a believable dynamic world. Thus, one of the basic elements that such a videogame should feature is a day and night cycle. In this thesis, all of the intricacies that are involved in developing a physically based day and night cycle solution in a real-time rendering context are discussed. The main topics that will be covered are atmosphere rendering, celestial bodies positioning, celestial bodies rendering and nighttime scenes rendering