Screenshot for my final render at 1920x1080 in 6 ms of the WDAS cloud dataset. Tested on RTX 3080 at stock clock speeds.
I made this project as part of the DD2470 Advanced Topics in Visualization and Computer Graphics course at KTH during end of 2024. My aim for the project was to render the Disney Moana cloud (half resolution), at acceptable real-time frame rates, while keeping visual degradation low.
- Unity HDRP v6000.0.23f1
- Fullscreen custom pass
- Using a wrapper for NanoVDB, see README in plugins folder
- Your typical ray marching algorithm with only directional light
I've listed the source files of importance:
- NanoVolumeCustomPass.cs - handle the rendering on CPU
- NanoVolumeCustomPassShader.shader - unity shader that calls my ray marcher
- NanoVolumePass.hlsl - the ray marcher that draws the volume
- NanoVolumeLoader.cs - resposible for loading the NanoVDB into Unity
- NanoVDBWrapper.cpp - wrapper for the NanoVDB C++ library
And of couse, this would not be possible with out PNanoVDB.h, which I've imported as PNanoVDB.hlsl
instead, just for clarity. This is where the magic happens.
A prebuilt version as an .exe
is found under releases. It will hopefully show the WDAS cloud.
This implementation is more of a proof of concept, rather than a complete project. This means, I have an absolute path to the wdas_cloud_half.nvdb
file, which is excluded from this repo, making it a bit more cumbersome from someone else to run. You have to download a regular .vdb
file, convert it to a .nvdb
and place it directly under the Assets/
folder. Then inside Unity Editor, make sure that the NanoVolumeLoader.cs
on the Volumetric Cloud Pass
game object has correct path.
I decided to read .nvdb
directly just to skip importing all of OpenVDB.
List of sources I have used in no particular order:
Walt Disney Animation Studios. “Walt Disney Animation Studios - Clouds.” Accessed January 6, 2025. https://disneyanimation.com/resources/clouds/.
Museth, Ken. “NanoVDB: A GPU-Friendly and Portable VDB Data Structure For Real-Time Rendering And Simulation.” In ACM SIGGRAPH 2021 Talks, 1–2. Virtual Event USA: ACM, 2021. https://doi.org/10.1145/3450623.3464653.
Museth, Ken. “Hierarchical Digital Differential Analyzer for Efficient Ray-Marching in OpenVDB.” In ACM SIGGRAPH 2014 Talks, 1–1. Vancouver Canada: ACM, 2014. https://doi.org/10.1145/2614106.2614136.
Gaida, Sebastian. “Real-Time Implementation of OpenVDB Rendering.” Master’s Thesis, Universität Koblenz - Landau, 2022.
Schneider, Andrew. “Nubis3: Methods (and Madness) to Model and Render Immersive Real-Time Voxel-Based Clouds.,” August 5, 2023. https://www.guerrilla-games.com/read/nubis-cubed.
Wrenninge, Magnus. Production Volume Rendering 2017. 0 ed. A K Peters/CRC Press, 2012. https://doi.org/10.1201/b12698.
Högfeldt, Rurik. “Convincing Cloud Rendering - An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite.” Master’s Thesis, Chalmers University of Technology, 2016.
Hillaire, Sebastien. “Physically-Based & Unified Volumetric Rendering in Frostbite - Frostbite.” Electronic Arts Inc., August 20, 2015. https://www.ea.com/frostbite/news/physically-based-unified-volumetric-rendering-in-frostbite.