Skip to content

Creating a GridBuffer with PNanoVDB (DX12/HLSL) #1307

Answered by gaida-exe
gaida-exe asked this question in Q&A
Discussion options

You must be logged in to vote

Well, let's answer my own question.
Yes, NanoVDB and PNanoVDB are fully compatible.
You need to use Nano on the CPU, if you plan on using shaders to compute. Just simply copy PNanoVDB.h to your shaders folder, include it in your shader and use a language define like #define PNANOVDB_HLSL
If you want to upload via something like DX12 you simply just need a StructuredBuffer without any type of splitting the NodeTypes (using CNanoVDB is different here aka the Viewer, where you need to bind the range).
The StructuredBuffer needs a few things from Nano:

const nanovdb::GridHandle<nanovdb::HostBuffer> grid = nanovdb::createFogVolumeSphere<float, float, nanovdb::HostBuffer>(100.0f, nanovdb::Vec3f…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gaida-exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
1 participant