I’ve made one of my first HDK plugin. This was more a test in order to work with volumes in c++. You can find the code here.
This node read one volume on input1 and advect the data with 3 volumes on input2. I’ve made a comparaison with Vex and Opencl with a volume of 100*100*100 and 3 substeps in advection :
HDK advect : 1.813s
Volumewrangle : 0.398s
Opencl : 0.025s
I was surprised to get so much differences. My code in HDK is not threaded and I guess not optimized, I’ve made a test to thread my code with THREADED_METHOD2 but I didn’t get any improvement yet. My next step will be to try threads, opencl or cuda in HDK.
The Opencl Code seems in this case much better, for those who want to have a look the otl is here and I have a hip file here. (made with indie licences)
I always though you can only edit one data at a time with Sop Solvers but in fact you can output multiple datas from a Sop Solver. : sop_solver.hip
I’ve seen this with the vellum constraint and you need to use a compile block. In this example I just move some geometry from a data to an other but it can be very useful when you have many data to edit like a smoke object.
As the vdb_advect node was very slow, I decided to make my own advect node in Opencl : advect_opencl.hip
I’ve made a forward and backward advection. I’m uploading this node as it shows how to use atomic add with floats inside Houdini for the forward advection. It also use a bilinear interpolation to read or write into the voxels.