This sample demonstrates how high-quality light scattering effects in large outdoor environments can be rendered on Intel HD graphics in real time. The technique extends the approach shown in the previously published sample and is based on the same key concepts. Epipolar sampling helps minimize the number of samples for which expensive ray marching algorithm is executed while 1D min/max binary trees are used to accelerate scattering integral computation. The sample source code is also available on GitHub.
In this sample, a more complex physical model is exploited to simulate light interaction with the atmosphere. The model assumes that the planet is spherical and that the particle density decreases exponentially with the altitude computed with respect to the planet surface. To facilitate shadows in large environments, cascaded shadow maps are used. Scattering contribution from each cascade is computed and accumulated to obtain the final result.
The technique is capable of rendering the scattering effects from both outer space as well as from the ground. The following figures show the effect computed for different camera locations and day times.