A volumetric cloud render based on OpenGL. Implementing:
- Preetham model to render the sun and sky
- Pre-computed Perlin-worley noise to calculate cloud density
- Simplex 3D noise to calculate curl
- Ray marching to calculate cloud lighting
Compile and build using CMake
. Configure using IDE or build with command line
cmake --build build --config Release --target all -j 12
- C++ 20
- OpenGL 3
- GLFW, GLEW, GLM(included in external)
Key | Operation |
---|---|
Drag mouse | Tilt camera |
W | Forward |
A | Backward |
S | Left |
D | Right |
Q | Up |
Z | Down |
↑ | Rise sun |
↑ | Fall sun |
← | Decrease coverage (less rain cloud) |
→ | Increase coverage (more rain cloud) |
Frame rate is outputed to stdout
per 5s.
Please don't go above the clouds, below the surface, or outside of radius as it triggers bugs!
- Sample Perlin-Worley noise to create cloud models. (See perlinworley.h)
- Calculate light intensity going through clounds based on Beer-Lambert law. (Line 271 in sky.frag)
- Account for scattering. (Line 265 in sky.frag)
- Account for absorption. (Line 279 in sky.frag)
- Calculate sky color in four discrete times of a day: sunrise, noon, sunset and night, using Preetham model. (Line 55 in sky.frag)
- Use ray marching to render clouds. (Line 242 in sky.frag)
- FPS ≥ 3. (See
stdout
) - Use a user-interface to determine rain cloud density. (See above)
The Real Time Volumetric Cloudscapes of Horizon Zero Dawn
NUBIS: AUTHORING REAL-TIME VOLUMETRIC CLOUDSCAPES WITH THE DECIMA ENGINE
A Practical Analytic Model for Daylight