{"id":24583416,"url":"https://github.com/andersblomqvist/unity-nanovdb-renderer","last_synced_at":"2025-03-17T17:11:45.075Z","repository":{"id":271571668,"uuid":"900786635","full_name":"andersblomqvist/unity-nanovdb-renderer","owner":"andersblomqvist","description":"A proof of concept renderer for NanoVDB in Unity 6","archived":false,"fork":false,"pushed_at":"2025-01-08T14:48:37.000Z","size":13676,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T04:41:17.038Z","etag":null,"topics":["nanovdb","openvdb","unity3d","volume-rendering","volumetric-clouds"],"latest_commit_sha":null,"homepage":"","language":"HLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andersblomqvist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T13:23:18.000Z","updated_at":"2025-01-23T12:39:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"f232cc40-fcb0-4531-8c80-d57bb039223d","html_url":"https://github.com/andersblomqvist/unity-nanovdb-renderer","commit_stats":null,"previous_names":["andersblomqvist/unity-nanovdb-renderer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersblomqvist%2Funity-nanovdb-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersblomqvist%2Funity-nanovdb-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersblomqvist%2Funity-nanovdb-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersblomqvist%2Funity-nanovdb-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andersblomqvist","download_url":"https://codeload.github.com/andersblomqvist/unity-nanovdb-renderer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244075638,"owners_count":20393979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nanovdb","openvdb","unity3d","volume-rendering","volumetric-clouds"],"created_at":"2025-01-24T04:40:51.917Z","updated_at":"2025-03-17T17:11:45.070Z","avatar_url":"https://github.com/andersblomqvist.png","language":"HLSL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity NanoVDB Volume Renderer\n\n![wdas_final_render](./final-result.png)\n*Screenshot for my final render at 1920x1080 in 6 ms of the WDAS cloud dataset. Tested on RTX 3080 at stock clock speeds.*\n\n\nI made this project as part of the [DD2470 Advanced Topics in Visualization and Computer Graphics](https://www.kth.se/student/kurser/kurs/DD2470?l=en) course at KTH during end of 2024. My aim for the project was to render the [Disney Moana cloud](https://disneyanimation.com/resources/clouds/) (half resolution), at acceptable real-time frame rates, while keeping visual degradation low.\n\n## Implementation\n\n* Unity HDRP v6000.0.23f1\n* [Fullscreen custom pass](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@17.0/manual/Custom-Pass-Creating.html)\n* Using a wrapper for NanoVDB, see [README in plugins folder](https://github.com/andersblomqvist/unity-nanovdb-renderer/tree/main/Assets/Plugins)\n* Your typical ray marching algorithm with only directional light\n\nI've listed the source files of importance:\n\n* [NanoVolumeCustomPass.cs](https://github.com/andersblomqvist/unity-nanovdb-renderer/blob/main/Assets/NanoVDB/NanoVolumeCustomPass.cs) - handle the rendering on CPU\n* [NanoVolumeCustomPassShader.shader](https://github.com/andersblomqvist/unity-nanovdb-renderer/blob/main/Assets/NanoVDB/NanoVolumeCustomPass.shader) - unity shader that calls my ray marcher\n* [NanoVolumePass.hlsl](https://github.com/andersblomqvist/unity-nanovdb-renderer/blob/main/Assets/NanoVDB/NanoVolumePass.hlsl) - the ray marcher that draws the volume\n* [NanoVolumeLoader.cs](https://github.com/andersblomqvist/unity-nanovdb-renderer/blob/main/Assets/NanoVDB/NanoVolumeLoader.cs) - resposible for loading the NanoVDB into Unity\n* [NanoVDBWrapper.cpp](https://github.com/andersblomqvist/unity-nanovdb-renderer/blob/main/Assets/Plugins/NanoVDBWrapper.cpp) - wrapper for the NanoVDB C++ library\n\nAnd of couse, this would not be possible with out [PNanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/PNanoVDB.h), which I've imported as `PNanoVDB.hlsl` instead, just for clarity. This is where the magic happens.\n\n## Built version in releases\n\nA prebuilt version as an `.exe` is found under releases. It will hopefully show the WDAS cloud.\n\n## Some caveats, if you wish to run in Unity Editor\n\nThis 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.\n\nI decided to read `.nvdb` directly just to skip importing all of OpenVDB.\n\n## Resources\n\nList of sources I have used in no particular order:\n\n**Walt Disney Animation Studios**. “Walt Disney Animation Studios - Clouds.” Accessed January 6, 2025. https://disneyanimation.com/resources/clouds/.\n\n**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.\n\n**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.\n\n**Gaida, Sebastian**. “Real-Time Implementation of OpenVDB Rendering.” Master’s Thesis, Universität Koblenz - Landau, 2022.\n\n**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.\n\n**Wrenninge, Magnus**. Production Volume Rendering 2017. 0 ed. A K Peters/CRC Press, 2012. https://doi.org/10.1201/b12698.\n\n**Högfeldt, Rurik**. “Convincing Cloud Rendering - An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite.” Master’s Thesis, Chalmers University of Technology, 2016.\n\n**Hillaire, Sebastien**. “Physically-Based \u0026 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.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersblomqvist%2Funity-nanovdb-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandersblomqvist%2Funity-nanovdb-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersblomqvist%2Funity-nanovdb-renderer/lists"}