SDF Volume Mix

   6647   3   1
User Avatar
Member
859 posts
Joined: Oct. 2008
Offline
I want to create some objects by converting volumes into polygons. I noticed that SDF gives smoother results but the problem is that when I use volume mix (say to subtract volume one from volume two) I get box-like boundaries.

How do I get rid of these while still using SDFs?
--
Jobless
User Avatar
Member
110 posts
Joined:
Offline
Invert the sign in the ISO Offset node, or use a Fog primitive.
User Avatar
Member
859 posts
Joined: Oct. 2008
Offline
Inverting kind of gets lost when you mix two volumes though. I always end up with boundaries.I would like to prevent that. Fog works, but as I said the quality seems lower. I attached a file.

Attachments:
volumes.hipnc (112.9 KB)

--
Jobless
User Avatar
Member
789 posts
Joined: April 2020
Offline
For me the trick was to always be aware of what the data in the volume actualy means. In an sdf each voxel stores the closest distance to the surface that was used to generate the field. I always forget, but you can easily check if inside is positive or negative. Let's assume negative. That means that Boolean operations are performend by using simple math operations like min and max (and inverting the fields for some) in Ron fedkew's book on levelsets all the operations are derived, but they are also easily found by drawing some shapes on a piece of paper, and looking at which operation provides the correct result.

I think for example a “union” is done with min(a,b). Perhaps looking for sdf boolean operations on google will give you the full list.

I don't have Houdini here, but if I remember correctly in either 9 or 10, a great explanation on fog vs sdf appeared in the help, perhaps under the volume rendering section?

Cheers,
koen
  • Quick Links