Editing volume fields ?

   4663   6   0
User Avatar
Member
253 posts
Joined: July 2006
Offline
Let's say I have a poly sphere, converted to sdf vdb, now I'd like to edit the fields in the voxels, something like this:

if ( sdfValue < -0.2 && sdfValue > -0.3 ) sdfValue = 0;

Or some other trick so that when I convert it back to polygons I'll get certain thickness.

Some how in vops maybe ?? Thanks.
User Avatar
Member
7734 posts
Joined: July 2005
Online
You can use a Volume VOP SOP to do such editing. Note once you do this, you'll get an invalid SDF, that you should renormalize to make valid again using the Volume SDF SOP.

I'm not sure that just setting them to zero works though. You might also need to set the voxels within the walls of your “thickness” to some inside value as well.
User Avatar
Member
253 posts
Joined: July 2006
Offline
Crap, the volume sop is behaving weirdly.

I managed to do it with volume mix though.

When I replicate what I'm doing with vol mix in vol vop, I get some weird boxes inside, and the vol sdf sop seems to have no effect.

In vol mix I'm setting mix method to user and an expression in the value field:

if ( $V < -1 , 0 , $V )

This is working ok, but the help says it's much faster en vops. Indeed, I checked the cook times and it's 5 times faster.


Also, how could we get rid of the “voxels” at the inside and side wall of the sphere ? Im getting these with the vol mix too.

I realize it's because of the clamping that i'm doing with the sdf but I can't figure the math needed.

Scene included.


http://s30.postimg.org/rtw90tkpt/send_a.jpg [s30.postimg.org]

http://s30.postimg.org/j6j1mt6w1/send_b.jpg [s30.postimg.org]

Attachments:
vol_hole.hip (111.7 KB)

User Avatar
Member
7734 posts
Joined: July 2005
Online
Sorry, I don't get time to try out .hip files these days from the forum. Try converting to a native Houdini volume first and then using the Volume VOP.
User Avatar
Member
8595 posts
Joined: July 2007
Offline
not sure if applicable for your needs, but to get simple stuff like volume thickness, boolean operations, etc. you can use vdb tools like VDB Reshape SDF and VDB Combine

otherwise you would really need to be careful with your SDF values if edited manually

Attachments:
vol_hole_vdbbool.hip (73.1 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
253 posts
Joined: July 2006
Offline
Edward, yes, thanks, works fine now with regular volumes.

Tamte, VERY interesting, thanks a lot.
User Avatar
Member
7734 posts
Joined: July 2005
Online
The problem that you're likely running into is that the Volume VOP only runs over the “active” voxels in the VDB. Unlike native volumes, VDB doesn't have a “bounding box” that dictates where the active voxels occur. For VDB, the active voxels can be anywhere in space. So you probably needed have a sufficiently large half-width when doing your VDB From Polygons so that the Volume VOP can modify it.
  • Quick Links