// This code multiplies each voxel in the density volume by 0.5 // Bindings #bind vdb &density float #bind point &P float3 @KERNEL { float3 pos = @P; float d = @density.worldSample(pos); d *= 0.5; @density.set(d); }
opencl baby steps
619 2 3-
- Soothsayer
- Member
- 874 posts
- Joined: 10月 2008
- Offline
I'm trying to wrap my head around the opencl sop by walking through it with baby steps. What's wrong in the following code?
--
Jobless
Jobless
-
- AslakKS
- Member
- 184 posts
- Joined: 2月 2016
- Offline
The problem is that a vdb does not have v@P, use @nameofvolume.pos instead ![](/static/djangobb_forum/img/smilies/smile.png)
https://www.sidefx.com/docs/houdini/vex/ocl.html#vdb-binding-methods [www.sidefx.com]
![](/static/djangobb_forum/img/smilies/smile.png)
https://www.sidefx.com/docs/houdini/vex/ocl.html#vdb-binding-methods [www.sidefx.com]
// Bindings #bind vdb &density float @KERNEL { float3 pos = @density.pos; float d = @density.worldSample(pos); d *= 0.5; @density.set(d); }
-
- Soothsayer
- Member
- 874 posts
- Joined: 10月 2008
- Offline
-
- Quick Links