Min/Max values for VDB?

   8986   4   2
User Avatar
Member
339 posts
Joined: 8月 2007
Offline
It appears that the volumemin/max doesn't function on VDB's. I can't find an equivalent vex function either. Say I want to normalize a curvature field, how should I go about that?
Converting to native format also seems to produce bad results because of the change in values at the edge of the narrow band.

Any ideas?
Jesse Erickson
Fx Animator
WDAS
User Avatar
Member
45 posts
Joined: 7月 2005
Offline
There must be better way but you can use HOM for that.
Something like,

geo = hou.node('/obj/torus/vdbfrompolygons1').geometry()
prim = geo.prims()
data = prim.voxelRange(prim.activeVoxelBoundingBox())
print min(data), max(data)

It would be nice if min/max is saved in Intrinsic Data like regular Volume.
User Avatar
Member
1 posts
Joined: 1月 2017
Offline
I needed to do this recently and found a solution in vex, this is possible in 16.5 and probably earlier using something like the following

int primNum = nametoprim(geoself(),"debris");
float debrisMax = primintrinsic(geoself(),"volumemaxvalue", primNum);

debrisMax will contain the highest value of any voxel in the volume debris.
User Avatar
Member
45 posts
Joined: 7月 2005
Offline
I could be wrong but I don't think “volumemaxvalue” intrinsic data is available for VDB.
User Avatar
Member
339 posts
Joined: 8月 2007
Offline
That's correct Sho. I originally posted this so long ago so I can't remember what the issue was. I've been converting to native volumes and pulling the volumeminvalue and volumemaxvalue prim intrinsics without issue for as long as I can recall.
Jesse Erickson
Fx Animator
WDAS
  • Quick Links