Skip to content

[NanoVDB] Is it really possible to modify the voxel values, and how? #1208

Answered by jmlait
Nord3D asked this question in Q&A
Discussion options

You must be logged in to vote

It is possible in principle as you can add your own functions in addition to the provided headers :>

Since you are looking at cnanovdb_readaccessor, note that it has acc->mNode[0..3]. If you first run a cnanovdb_readaccessor_getValue, you will have set the mNode[0] to a non-null if the leaf node exists. If the leaf node doesn't exist, you can't write to it because you can't change topology.

Then, to write to it, you can use

cnanovdb_node0F *node = acc->mNode[0];
uint32_t n = cnanovdb_node0F_CoordToOffset(ijk);
node->mVoxels[n] = newvalue;

Now, you say you want it in the 18.5 OpenCL SOP.... This likely will "work". But the danger is that Houdini will be unaware you made any changes, it do…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Nord3D
Comment options

Answer selected by Nord3D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants