Fairbanks Weather Phenomena in Godot
UAF CS 485 → Computer Graphics Rendering (Fall 2022)
Problem Statement
Summarized as balancing physical weather effects and their corresponding representation in Godot, the initial starting point for this project began with light pillars and ice fog characteristics, as narrowing down the scope was critical for setting attainable goals for this semester.
Here are some nice light pillars on this cold night in Fairbanks, sent in from one of our Meteorologists. #akwx pic.twitter.com/DMLvE9TGNT
— NWS Fairbanks (@NWSFairbanks) November 3, 2020
The attempted effect drew inspiration from a US National Weather Service Fairbanks Alaska post (see above), where they observe tiny ice crystals forming radiant columns of light as vertically stacked mirrors float within the atmosphere.
Technical Approach
Each pillar consisted of an apex and base (both PrisimMesh) on either end of a CylinderMesh. The Spatial Ice Shader by NekotoArts & Gabriel Aguiar formed the foundation of inspiring color gradients along the original light pillars.
Ice fog builds upon a Godot tutorial titled Adding atmospheric 3D fog patches to a scene by Martin Senges. Starting with a circular drawing in GIMP with CPUParticles and Atmospheric particles yields a realistic effect at differing intensity levels.
Node Configuration Warning
Note that on macOS, particle rendering is much slower than CPUParticles due to transform feedback implementation on the CPU instead of the GPU. When targeting macOS devices, utilize the project setting (within the toolbar options) to convert to CPUParticles.
The ground is 2500 x 2500 QuadMesh rotated and transformed about the origin. Materials such as Fog from a Custom Color world environment – with a slight depth curve – yield a convincing skyline of Fairbanks, Alaska.
After the minimum viable tech demo, the focus shifted towards adding light source objects for pillars within a ray-traced object. Raytracing demo 2: sphere and plane by Dr. Orion Lawlor adapted nicely into a raytraced cylinder intersection.
Each lamp post consists of a light cap (CylinderMesh) and color temperature calibrated with OmniLight. The street lamp originates from a free 3D model by tyrosmith, broken into six different surfaces.
Additional colors are added via the Albedo color to improve contrast with the background. The ground texture formulates from a zoomed-in image of Aerial Asphalt 01 texture by Rob Tuytel (CC0). Alterations to the 4K graphic show similarity to snowfall on a highway road.
Conclusion
Some key takeaways and lessons learned include taking the subsection of shape when given an inverted normal (like a light pillar). Knowing how to adapt the camera perspective and the ability to cull a 2D object also prove valuable.
Possible next steps for this project include improving scalability via different light sources (such as street lamp color temperature) and feathering edges of cylindrical objects as smooth surfaces.
My code and graphical assets are within the GitHub repository. This project runs on Godot Engine v3.5.1 Stable Edition.
Further Reading
- Atmospheric Halos and the Search for Angle x (Walter Tape & Jarmo Moilanen)
- Physically Based Rendering of Ice Crystal Halos (Arthur Pereira Vala Firmino)
- 3.3 Cylinders – Physically Based Rendering (Matt Pharr, Wenzel Jakob, & Greg Humphreys)
- What Causes Halos, Sundogs and Sun Pillars? (National Weather Service)
- The Physics of Snow Crystals - Morphogenesis on Ice (Caltech)
- Atmospheric scattering and “volumetric fog” algorithm – part 1 (Game Developer)
- Computer Science Fog Machine Improves Computer Graphics (UCSD)
- Chapter 16. Accurate Atmospheric Scattering (NVIDIA Developer)
- Efficient Rendering of Atmospheric Phenomena (Eurographics Symposium on Rendering, 2004)