-
Hi |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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
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 doesn't support the Writabel flag so assumes the value is invariant. This may cause some weird issues if you have the VDB show up elsewhere as Houdini may re-use the GPU buffer unaware it no longer reflects the VDB value, so you changes may "leak" to other operations. Likewise, the changes won't write back to the VDB on the CPU side. So if something forces the geometry off the GPU and back onto the CPU (such as moving the geometry through a CPU only node, which is most of them) your changes will vanish. But if you have your own tight loop of GPU code the changes should persist, and if your output is something other than the VDB itself, it should work. Which is a long way of saying "here be dragons". The data structure supports changes - no internal pointers are invalidated by changing voxel values - but there is a good reason we've not made easy ways of doing this out of the box. |
Beta Was this translation helpful? Give feedback.
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
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…