Rendering pretty sky in Around The World game
The author of the Around The World game created a custom recursive Monte Carlo ray tracer in Rust to investigate how povray handled multiple scattering. This led to the discovery that povray did not simulate multiple scattering, which greatly affected the appearance of clouds in the game.
After confirming this, the author created a lookup table for light scattering in clouds, which had a significant impact on the overall look of the clouds. They found that multiple scattering resulted in a more uniform distribution of light, making clouds appear lighter overall. However, this effect was less noticeable with lower cloud density due to the limited opportunity for light to scatter multiple times.
The author then considered how to account for indirect sunlight in clouds, making them blend better with the sky. They discovered that by tweaking the normal direction of the clouds to point upward towards the sky, the clouds took on a blueish hue, better matching their appearance in reality. This adjustment was particularly noticeable during sunset, when clouds took on a pink hue due to the mix of red direct sunlight and blue indirect sky light.
Another issue the author faced was that the sky appeared unnaturally yellow near the horizon, even when the sun was overhead. They suspected this was due to excessive outscattering during the raymarch process. By altering the order of operations during the ray march, they were able to reduce the attenuation during inscattering, resulting in a much more realistic sky.
Finally, the author addressed the issue of rendering a realistic sky for a smaller planet in the game. They had to use Earth-like atmospheric parameters, but due to the planet's smaller size, the horizon appeared above the real horizon. This led to inconsistencies in the sky shader. The author concluded that using Earth parameters for a smaller planet would need adjustments to ensure a more accurate representation of the sky.
Rewritten by urgent.news; may contain errors — check the original.
Source: frozenfractal.com