# Trying volume displacement along a linear axis

## Recommended Posts

I'm trying to make a volume that dissolves along the x axis like this.

But my volume is getting dissolved inwards like this..

What should I do?

##### Share on other sites

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.

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

• 1

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

##### Share on other sites
Posted (edited)

Finally I was able to get significantly better output.

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.

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

In the tutorial video, coloured trails are visible.

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

Edited by archz2

##### Share on other sites
Posted (edited)

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.

Edited by ryew
quick tip on re-centering geo to 0,0,0
• 1

##### Share on other sites

I think I would use particles to drive the entire effect.

ap_smoke_dissolve_along_one_axis.hipnc

• 4

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

sphinx_polyreduced_02.rar

• 1

##### Share on other sites
Posted (edited)

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.

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

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

Edited by archz2

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

VOL DISPLACEWORK F2.hip

• 1

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

##### Share on other sites

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

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.

Is it something to do with stash1.bgeo ?

## Create an account

Register a new account