Jump to content

Spit SDF in volumes


Nerox

Recommended Posts

Hi,

I try to create a custom force field. I figured that if I could use the direction stored in a Sign Distance Field as a force, I should be able to control the shape of a ball of liquid.

DOPs would like to have xyz seperated volumes as input to feat into a sopscalarfield DOP. I figured I should be able to do this in a vopsop but I can't get my head around it.

I've declared a volume and I feat this in to the first input of the vopsop, the second input receives the SDF. I thought that I should be able to sample the SDF and store the xyz in differend volumes. I've used the volume Output in VOPs, but the result doesn't look like what I expect. It seems the volume I declare goes through without being effected.

Any idea's?

Tnx!

Nick

SDF_to_volumes_V01.hip

Link to comment
Share on other sites

Hi,

I try to create a custom force field. I figured that if I could use the direction stored in a Sign Distance Field as a force, I should be able to control the shape of a ball of liquid.

DOPs would like to have xyz seperated volumes as input to feat into a sopscalarfield DOP. I figured I should be able to do this in a vopsop but I can't get my head around it.

I've declared a volume and I feat this in to the first input of the vopsop, the second input receives the SDF. I thought that I should be able to sample the SDF and store the xyz in differend volumes. I've used the volume Output in VOPs, but the result doesn't look like what I expect. It seems the volume I declare goes through without being effected.

Any idea's?

Tnx!

Nick

Another way to create a custom fieldforce is to plug a sopgeo containing a vector point attribute "force" into second input.

fieldForceGEO.hip

Link to comment
Share on other sites

I was playing around with the above example because I was asking someone earlier about creating this exact effect. I have a couple of questions if you don't mind Mawi. Why do you use the POP object and pop solver instead of just creating a pop network in SOPS? Can you do this in SOPS instead of going into DOPS? Also, when I use a Location to birth particles in my POP network, everything works fine. But when I use a grid as the input of a source pop, I get a cook error. I am attaching a file that has a switch at the bottom of the network to switch between the location and grid source pop networks. If you can take a look I would super super appreciate it! :)

Cheers,

Jason

Edited by mightcouldb1
Link to comment
Share on other sites

Hi,

I try to create a custom force field. I figured that if I could use the direction stored in a Sign Distance Field as a force, I should be able to control the shape of a ball of liquid.

DOPs would like to have xyz seperated volumes as input to feat into a sopscalarfield DOP. I figured I should be able to do this in a vopsop but I can't get my head around it.

I've declared a volume and I feat this in to the first input of the vopsop, the second input receives the SDF. I thought that I should be able to sample the SDF and store the xyz in differend volumes. I've used the volume Output in VOPs, but the result doesn't look like what I expect. It seems the volume I declare goes through without being effected.

Any idea's?

Tnx!

Nick

Hey Nick, You had the right idea there, just in the wrong node :)

Anytime you're dealing with writing data into a Volume you need to use a Volume VOP. The volume sampling nodes in a VOPSOP are just used to affect points. Also you only need a vector volume to sample into, not a matrix volume which will create 16 individual volume grids. Have a look at this file, hopefully it's what you're after. The print node in there is just to save you from having to write the op: expression.

SDF_to_volumes_V02.hip

Link to comment
Share on other sites

Hey guys,

I took the above file by tjeeds and experimented with it a bit, I also did a little bit of experimenting with the advectbyvolume POP. I have encountered a few grey areas and I was hoping that someone might be able help clarify for me. I posted stickynotes with all of the questions that I had in the attached file. There are about 5 or so questions that could be answered relatively quickly. I hope I am not asking too much of anyone. Thanks in advance!

SDF_to_volumes_V02_mightcouldb1.hip

Link to comment
Share on other sites

Hey guys,

I took the above file by tjeeds and experimented with it a bit, I also did a little bit of experimenting with the advectbyvolume POP. I have encountered a few grey areas and I was hoping that someone might be able help clarify for me. I posted stickynotes with all of the questions that I had in the attached file. There are about 5 or so questions that could be answered relatively quickly. I hope I am not asking too much of anyone. Thanks in advance!

Mightcouldb1,

I can't answer all of your questions but this is one of them:

1. Can anyone explain why multiplying the gradient by the volume sample yields a velocity direction?

If you multiply a vector by a float, it results in a vector with the same directions but with a bigger power/higher value. The volume sample, samples the SDF at each voxel. It returns a normalised vector, this vector points towards the closest point of the surface represented by the SDF. The volume gradient does the same, but returns a float which represents the distance to the closest point of the surface.

So if you use this multiplied vector as the velocity for particles, in case they're inside the voxel box area, there pulled towards the surface of the SDF.

I know, it's complicated, it took me a wile to get it ;-). (Awesome video about this and DOPs: CMIVFX.com fluids for td's)

I've inverted the velocity in the volumeVOP this changes the effect dramatically, the particles inside the sphere where pulled towards the center. By inverting the vel, the particles are pulled towards the surface. I've also adjusted the surface a bit. This way you can create awesome shapes with particles.

SDF_to_volumes_V03.hip

Link to comment
Share on other sites

I was playing around with the above example because I was asking someone earlier about creating this exact effect. I have a couple of questions if you don't mind Mawi. Why do you use the POP object and pop solver instead of just creating a pop network in SOPS? Can you do this in SOPS instead of going into DOPS?

It was just to show how to connect a geometry to a fieldforce. You sure can make particles follow a curve in other POPS.

Also, when I use a Location to birth particles in my POP network, everything works fine. But when I use a grid as the input of a source pop, I get a cook error. I am attaching a file that has a switch at the bottom of the network to switch between the location and grid source pop networks. If you can take a look I would super super appreciate it! :)

Cheers,

Jason

In your source POP change "geometry source" to "Use Parameter Values" and choose your grid in the SOP path.

Link to comment
Share on other sites

Hey guys,

I took the above file by tjeeds and experimented with it a bit, I also did a little bit of experimenting with the advectbyvolume POP. I have encountered a few grey areas and I was hoping that someone might be able help clarify for me. I posted stickynotes with all of the questions that I had in the attached file. There are about 5 or so questions that could be answered relatively quickly. I hope I am not asking too much of anyone. Thanks in advance!

Why is is necessary to format the string with the op: expression instead of feeding the filepath directly?

Its a way to make the volumegradientfile1 read from a SOP-path instead of from disk as it expects.

Is creating a parameter the same as addAttribute in VOP SOPS? When I check the details view there is no evidence of a velocity attribute being passed down.

If you set the export to ALWAYS it will act like the addAttribute VOP. The reason you can not se the attribute is because volumes does not work the same as points. I think Peter Quint talks more about this in his basic volumes tutorials.

http://vimeo.com/channels/54102

when the particles leave the boundary of the SDF, they fly off into space in the same direction. Why does this happen?

They can only sample the SDF while inside the bounds.

I used sopgeo1 to import the final SDF from SOPs. I am using fieldforce1 and changed the force attribute to "vel" so that it would grab the velocity from the geo (even though the "vel" attribute is not visible). When the particles reach the edge of the volume, they stop instead of being pushed back in the direction of the velocty. Even if treat as wind is on, the particles still stop when they reach the edge of the volume. Can anyone explain why this happens, and how to fix it?

You are trying to bring a SDF in to DOPS through a sopgeo. SDF is a field so use a sopvectorfield1 instead.

If you are interested in fields, fluids and particles you should buy the CMIVFX.com fluids for td's

Link to comment
Share on other sites

Its a way to make the volumegradientfile1 read from a SOP-path instead of from disk as it expects.

If you set the export to ALWAYS it will act like the addAttribute VOP. The reason you can not se the attribute is because volumes does not work the same as points. I think Peter Quint talks more about this in his basic volumes tutorials.

http://vimeo.com/channels/54102

They can only sample the SDF while inside the bounds.

You are trying to bring a SDF in to DOPS through a sopgeo. SDF is a field so use a sopvectorfield1 instead.

If you are interested in fields, fluids and particles you should buy the CMIVFX.com fluids for td's

The CMIVFX.com video rocks! I've watched it over 15 times (some pieces) and still every time I discover something new or finally get the clew about something. It's really worth the money. I've also updated my basic math, i can tell you it's worth the effort. There are so much basic principals like multiplying a vector by a float, with if you understand the idea behind it, you can use it in your advantage in Houdini all the time.

The example about sopvectorfield1 which Mawi mentioned, there is an example in http://forums.odforce.net/index.php?/topic/10423-advect-fluid-with-vectorfield/ "]this[/url] thread.

Edited by Nerox
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...