Manipulating VDBs in OpenCL SOP Node?

   2311   3   1
User Avatar
Member
5 posts
Joined: Dec. 2020
Offline
Hi,

Following the same setup for OpenCL kernels in the OpenCL node, the generated kernel snippet gives a void * type pointer to the bound VDB. Also, there are no readable/writeable checkboxes in the bindings for VDB type parameters. After searching on this forum and googling for a while, I still couldn't find a feasible way to interact with VDBs in the OpenCL node. Any help is appreciated!

Thanks,
Peter
Edited by bwu - April 10, 2022 00:56:42
User Avatar
Member
5 posts
Joined: Dec. 2020
Offline
Just found two headers in the ocl/include path:

#include "CNanoVDB.h"
#include "CVDBUtil.h"

Then a recast to cnanovdb grid:
const global cnanovdb_griddata *grid = (const global cnanovdb_griddata *) vdb;

Voila! Now I can use cnanovdb family of functions to read VDBs.

Hope this helps!
User Avatar
Member
9 posts
Joined: July 2010
Offline
bwu
Just found two headers in the ocl/include path:

#include "CNanoVDB.h"
#include "CVDBUtil.h"

Then a recast to cnanovdb grid:
const global cnanovdb_griddata *grid = (const global cnanovdb_griddata *) vdb;

Voila! Now I can use cnanovdb family of functions to read VDBs.

Hope this helps!
Only "CVDBUtil.h" must be included, the other two headers are included in it:
#include "CNanoVDB.h"
#include "CSampleFromVoxels.h"
Here is the explanation with an example from Matt Puchala:
https://vimeo.com/477072175 [vimeo.com]
User Avatar
Member
4730 posts
Joined: Feb. 2012
Offline
In Houdini 20, OpenCL SOP and Gas OpenCL DOP can write to VDBs;
https://www.sidefx.com/docs/houdini/news/20/vex.html [www.sidefx.com]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
  • Quick Links