With computer graphics shaders making up an increasingly large part of visual effects in games, they become more and more important. Their high flexibility and performance allows for rendering complex visual effects like clouds or water. The goal of this thesis is to create a weather rendering system based on real meteorological data from meteoblue with an accurate 3D elevation model from ESRI.
Clouds in Nature are categorized into three major layers and consist of many unique characteristics.
The implementation of such visual effects often proves to be more challenging than anticipated.
Even though clouds are ever-present in games, it is still hard to get them right.
This is where shaders, small programs accelerated by the power of graphics cards, come into play.
This bachelor thesis aims to create a weather rendering system built almost exclusively with shaders.
Instead of using arbitrary parameters to control the simulation, the system is fed data directly from meteoblue weather reports for Bern, Switzerland. To account for the terrain, 3D elevation model data from ESRI is used.
Finally, in order to compare the rendered output with an actual picture of the same time and day, Roundshot photographs from the top of the Gurten and the Bantiger are periodically stored for the duration of the project.
The implementation is based on a seamless 3D noise texture that is generated with a compute shader.
Each distinct cloud layer is represented by a volumetric shader that makes different use of the noise texture.
Those shaders work with a technique called "ray marching", which means that the noise is sampled multiple times along a ray that is cast into the volume. This is excellent to estimate the density of clouds behind each pixel. The same method is used for lighting and illumination purposes, which gives the clouds additional depth and makes them appear 3D.
The simulation can be operated manually in a "play mode" or run automatically, controlled by the meteoblue weather report data.
Figure 2 shows that the final result resembles cloudscapes as they could appear naturally.
The achieved solution shows great results and is able to simulate various weather scenarios for all times of day.
The simulation can primarily render clouds of the family "cumulus", which means fluffy/heaped.
The distant clouds use a different location for the meteoblue weather reports. From the Gurten viewpoint, it is the weather for Solothurn. From the Bantiger viewport, it is Fribourg.
The use of a compute shader proved to have a huge impact on how well the simulation runs and outperformed the previous project's prototype by a factor of 300. This allowed to expand the complexity of the solution, which still runs at approximately 60 FPS in Full HD.