Jump to content

Trying volume displacement along a linear axis


Recommended Posts

Hello archz2,

Have you tried using a gas-field wrangle?

Just plug in a gas-field wrangle into the 4th input (advection stage) of your pyro/smoke solver and put in the following code:

f@density *= fit(@P.x, chf("X_Min"), chf("X_Max"), chf ("Dissipation_Max"), chf("Dissiplation_Min"));

Then click on the create spare parameters to get 4 sliders; 2 sliders for specifying the x-axis range to which you want to apply the effect to and the other 2 sliders to set the dissipation rates. In a nutshell, you are creating your own custom dissipation micro-solver using VEX code.

Then you can animate the sliders to create a sort of wipe effect. I'm assuming that this is the effect that you are going for.

As to how this works, each time the solver runs the gas-field wrangle it multiplies your density by a value in the range 0-1, effectively reducing the density over time. But please note that this effect follows an exponential decay curve, which means as the simulation runs the effect gets slower. I imagine this is how gases behave in the real world, but please don't quote me on that statement.

For creating artistic effects and for better overall control of the simulation, I prefer the subtractive approach. If you wish to use this method, then modify the code as follows:

f@density -= fit(@P.x, chf("X_Min"), chf("X_Max"), chf ("Dissipation_Max"), chf("Dissiplation_Min"));
if(f@density < 0){
	f@density = 0;
}

With the above piece of code, the dissipation becomes linear, removing a certain amount of density each time the wrangle is run. The extra code after the 1st line ensures that the density never goes below 0 since density is a float attribute and negative values can sometimes mess things up in your simulation. Similar to the exponential decay code, the sliders can be animated to create the desired effect.

I hope all of this makes some sense and is what you are looking for.

Link to comment
Share on other sites

You forgot to name the bind output in the volume VOP. vel in this case.
And also the ramp (ouside the vop) is all set to zero.

Like I said, I'm not an expert, but I've done these kind of mistakes plenty of times. I don't get fooled by this kind of stuff anymore haha.
Well...  almost.

  • Like 1
Link to comment
Share on other sites

6 hours ago, flcc said:

You forgot to name the bind output in the volume VOP. vel in this case.
And also the ramp (ouside the vop) is all set to zero.

Like I said, I'm not an expert, but I've done these kind of mistakes plenty of times. I don't get fooled by this kind of stuff anymore haha.
Well...  almost.

Hahaaha...Thanks a ton. :D Reminds of a quote by Nobel prize winning physicist Niels Bohr, "An expert is a man who has made all the mistakes which can be made, in a narrow field."

 I'm not in front of my computer right now. I'll surely get back when I go through the file again. Immensely grateful for your consistent support. 

Link to comment
Share on other sites

Finally I was able to get significantly better output. 

 

image.thumb.png.49d293846c8e3cd53d981295b857ecda.png

 

 

However, I'm still not able to get more spread out volume. However, I've solidified my volume to make it more clear in the screenshot. 

 

I intend to get this. 

image.png.e778c091861fe02ac5893044efb53118.png

 

Moreover, when I click on volume trails, I get a blank. 

image.thumb.png.af2274add620476cc5e74323e1627432.png

 

 

In the tutorial video, coloured trails are visible. 

image.thumb.png.fb7cbce950a16841f63afe79afa3cfb9.png

 

Here's the updated file. I've changed the noise frequency, the volume vop ramp and padding of bounding box. 

https://www.dropbox.com/s/3yw4x4kdnh50i56/VOL DISPLACEWORK.hip?dl=0

Edited by archz2
Link to comment
Share on other sites

You're not far off, but to make life easier for you, my very first suggestion would be to move all your work closer to (or at) the (0,0,0) point on the grid and it will make the work much easier, especially for issues like this.  For a quick and dirty way of doing this, just use -$CEX, -$CEY and -$CEZ respectively in your "Translate" attributes of the transform1 node to move the geo back to the origin from wherever it's at.

This is related to the reason your visualization isn't appearing.  The volume trail needs points within the area of the volume to trail from, but your grid is currently at (0,0,0) while your source geometry and volumes are many units below away from there (hence the first comment) - if you orient the grid to the YZ plane and move it to the area within your volume VOP output, you'll see the colored trails you're expecting.

voltrails.jpg.41f6358f1002e0f4b759e961eb0622ca.jpg

Edited by ryew
quick tip on re-centering geo to 0,0,0
  • Like 1
Link to comment
Share on other sites


Just play with the volume Vop frequency and roughness values.
Frequency 0,8,  roughness : 0.2 is close to you reference picture.
It's better to lower the resolution of the VDB while you play with these value, so you can almost see the result in reel time.
Also the padding value of the bound SOP are toot small.

And I Agree with ryew. Actually, that was the first thing I did when I opened your file.

But the main problem is the scale of your model. The model used in the tutorial is much smaller.
As a general rule, you have to make sure that  the scale of the model you use is very close to the model in the tutorial, otherwise you can be sure to not get the same result.
This is not specific to vdb or even houdini. This is the same with all dynamic, flip, rbd, noise etc.. stuffs


the original model is attached

VOL DISPLACEWORK F.hip

Capture.JPG

sphinx_polyreduced_02.rar

  • Like 1
Link to comment
Share on other sites

Thank you so much flcc and ryew filling in the parts where Entagma didn't explain in the tutorials. Immensely grateful. Is there a way to measure the bounding box and check the length of our model to get a better understanding of its scale? The grid definitely helps, but having exact numerical figure for dimensions will be super helpful. 

 

@flcc, your Houdini file works fine in the stl file of sphinx that I have.

 

image.thumb.png.efa0a5b3bf8b20e5061370c32e8a09b0.png

 

 

But when I import your sphinx_polyreduced_02.rar Obj file, I get a blank. 

 

image.thumb.png.f94af47cfb5d0fd31c5b6945ab58aab7.png

 

 

@Atom, I'll surely go through your file and get back. 

Edited by archz2
Link to comment
Share on other sites

Maybe you forgotten to disable the transform node ?
But anyway there is a difference of scale of ten, between the two models. You have to adapt some parameters.
For the size you can use a bound sop (with padding at zero). Middle click, and you can see the size in the info.

In the attached file you can comapre the two version.
You can slighly adjust the isooffset in the VDBConvert.
And in the VDBAdvect I change some value to speed up a bit the result. Don't really understand why but It is better to increase the substeps rather than the timestep. Check the doc.

Capture.JPG

VOL DISPLACEWORK F2.hip

  • Like 2
Link to comment
Share on other sites

Thank you so much! I've been caught up with lot of work and haven't been able to take out time to practice. I'll surely check out the file and get back. 

 

On 6/26/2021 at 11:10 PM, flcc said:

Don't really understand why but It is better to increase the substeps rather than the timestep.

Reminds me of the quote from the film 'Tenet' - "Don't try to understand it. Feel it.":D

Link to comment
Share on other sites

  • 2 weeks later...

Okay. So I got back to the file "VOL DISPLACEWORK F2.hip"  you shared. The left hand set works perfectly fine. 

 

image.thumb.png.d41828750ed5da1e4a17cdff2ef43698.png

 

In the right hand set, after loading the mesh file, I get very small geometry. You mention about disabling transform node which I did (and as pointed out by you, I was not doing it earlier). What exactly is its purpose then? It's just acting as a null node then eventually. 

 

 

image.thumb.png.d04803481450904d0683a29380712158.png

 

 

Is it something to do with stash1.bgeo ? 

 

image.png.aa90c1c51f9a2b2f9e9dc467a7ef0aaa.png

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...