bullet time, "matrix effect"

   48634   41   6
User Avatar
Member
793 posts
Joined: April 2020
Offline
Wow,

thanks for the write up. Seems like a great opportunity to bite the bullet and get a better understanding how dops work under the hood.

I'll keep you posted on my progress.

Koen
User Avatar
Member
793 posts
Joined: April 2020
Offline
Hello John (going of you login that seems your name, excuse me if it is not)

Thanks again for your explanation. I have the setup mostly up and running with some nice results. The one area that I don't have working yet is the gather step. I have attached two images. The smooth one shows the gather field in pink and streamers for the gather gradient. This is when I dont add the gather to the density.

When I do add a portion of this to the density, I get the second image. It seems there are negative values in there. I need to check what is going on.

On a side note, in order to ensure the gradient of the goal density gradient, I swapped the blur node by a volume ramp fed by a sdf field based on the goal. This way the falloff is completely controlable, that seems to be working very well in my limited tests.

Cheers,
Koen

Attachments:
gather_added.jpg (179.9 KB)
gather.jpg (101.1 KB)

User Avatar
Staff
823 posts
Joined: July 2006
Offline
Hi Koen,

I'm afraid since I'm away from Houdini I can't tell you how those gather screen shots compare to mine. I did realize I made a nasty mistake in my writeup above, in case you were following that and not the paper. The first step in calculating the gathering term is to subtract the goal field from the density, *not* densityblur from the density. Sorry about that.

Anyway, if I can make a couple of suggestions in general on “how to implement a Siggraph paper”. Feel free to ignore any or all.

1) If you can spare the $9.99, go to encore.siggraph.org and download the video of the presentation the authors gave at the original Siggraph if it's available (this one is). It's almost always worth it. This paper is not too impenetrable on its own, but I always like getting the authors' take on what's important, tricky, etc.

2) Simplify things as much as possible when trying to implement at first. In this case that means 2D simulations, do the driving force term first, worry about gather later, etc. Sounds like you're already on this path.

3) Try to recreate their examples if possible. In this case that's pretty simple. You can extrude some text and do an Isooffset and recreate either the single-character transitions from the paper, or the squiggly line into the “SIGGRAPH” letters. You probably found this via Google, but movies from the paper are here [cs.huji.ac.il].

So, along those lines, I'd encourage you to get it working it with the Gas Blur first, then switch the driving force to use an SDF later. That just removes one variable that might trip you up in recreating the examples. You can make it more controllable once yo get the effect working overall.

In general, the main requirement on the driving force is that the pressure projection stage can cancel out all velocities when the density field matches the goal field. That's the “rest state” they talk about in the paper. They achieve this in their formula by having the blurred density and goal fields cancel each other out, so you're left with just the gradient of the blurred field. The pressure projection should completely cancel the force out when it is the gradient of a smooth potential field. If you can meet this requirement with your smoothed SDF gradient, great, but I'd still do that as a second step once you already have it working like in the paper.

As for the gather, you should expect some negative values. The term is essentially the result of diffusing the error between the current state and the goal over time. In some case that means more density needs to be added to the current state, in some cases it means some should be removed. If you look at the figures in the paper where they compare the results with and without the gathering term, you'll see not only is there more density in the target position, there's less in the areas immediately surrounding it.

From my recollection of implementing this, with a 2D, unit square simulation, you ought to be able to come very close to matching that first figure (the single letter transition) with just the driving force at a resolution of about 128x128. If you try to transition to another goal state (say, another letter) from there, you'll just start to lose too much density to numerical dissipation. And none of the examples with a constantly moving target (like the bouncing smily face) will work without the gathering term.

I'll be back in front of my computer with Houdini on it in a few days and should be more helpful.

Good luck,
John
User Avatar
Member
793 posts
Joined: April 2020
Offline
Hey John,

Thanks again for the advice, I will definitely try to get the video. I was already doing most of what you mentioned in the second post, I have attached 4 stills from a sim. It currently is just the gather step I am working on.

Cheers,

Koen

Attachments:
smoke_almost.jpg (12.7 KB)
smoke_med.jpg (11.9 KB)
smoke_start.jpg (10.5 KB)

User Avatar
Member
793 posts
Joined: April 2020
Offline
one more image (posts are limited to 3)

Koen

Attachments:
smoke_done.jpg (13.2 KB)

User Avatar
Staff
823 posts
Joined: July 2006
Offline
Looking good! Interesting things to try from there are transitions to other goal states, multiple density fields and goals with a single velocity field, and a constantly moving target. Let us know how the gathering stuff goes.
User Avatar
Member
793 posts
Joined: April 2020
Offline
John,

It all works now. The problem turned out to be the multiplier on the gather term before adding to the density. I had is at 0.01, that causes the instability, it needs a few more zeros.

Thanks again!

Koen

Attachments:
clear.jpg (23.8 KB)

User Avatar
Member
89 posts
Joined: April 2008
Offline
Thank you John for taking the time to write this up, your posts are a great help!
User Avatar
Staff
823 posts
Joined: July 2006
Offline
koen
John,

It all works now. The problem turned out to be the multiplier on the gather term before adding to the density. I had is at 0.01, that causes the instability, it needs a few more zeros.

Thanks again!

Koen

Nice! You're very welcome. Yeah, I was surprised by how much I had to scale the gathering term down for it to work. I think I mentioned in one of my previous posts I ended up using something like 1e-5 as a default, and I've found I rarely used higher than 1e-4. Although with a constantly moving target it tends to need larger values for the gathering.

Is the above example using an SDF with a Volume Ramp? I've been meaning to try that so I'll have to give it a shot when I get back in front of Houdini.

John
User Avatar
Member
793 posts
Joined: April 2020
Offline
This example is using it. I like the ramp in that you get full control over the falloff of the gradient. It seems to work nicely. I now want to change the goal to also take the sdf and remap it just simply to a fog. That way still only 1 input is required.

Cheers,
koen
User Avatar
Member
89 posts
Joined: April 2008
Offline
I'm trying to follow this but I have hit a wall trying to get the “gathering” to work.

johner
I had more luck updating the density field during substepping by using VOPs and the “timeinc” global parameter.

Could you elaborate on this? I dont see how to do that. I was trying to add the gathering using a gas calculate node but its not working.

Another question, I had assumed that I could use several nodes to manipulate a field and wire them into a merge, and that each operation would be performed left to right, but now I'm not so sure. Is that correct?

Thanks again, this is a great way to learn more about dops.

Michael
User Avatar
Staff
823 posts
Joined: July 2006
Offline
mrice
I'm trying to follow this but I have hit a wall trying to get the “gathering” to work.

johner
I had more luck updating the density field during substepping by using VOPs and the “timeinc” global parameter.

Could you elaborate on this? I dont see how to do that. I was trying to add the gathering using a gas calculate node but its not working.
The gathering term is part of the material derivative of density, so you're basically numerically integrating that part of the equation by adding it to the density each timestep. And you should multiply by “delta t”, i.e. the timestep, before adding. With a Gas Calculate node, you can put the $TIMESTEP variable into the Source Pre-Mult parameter. The problem is that if you then increase the substepping on the smoke solver (which you may want to do if you have some high velocities) the TIMESTEP variable doesn't seem to respect that as far as I can tell from testing. In other words, with 4 substeps, TIMESTEP should be divided by 4 as well, so at the end of the frame you're accumulating roughly the same amount of density, but that division doesn't seem to be happening (or maybe there's another variable I don't know about?)

If you do it in VOPS, you basically just create a Gas Field VOP that has an extra parameter to pull in the “gather” field (whatever you have it called), and you'll want to multiply by the “timeinc” global variable before adding to the density. The timeinc variable does seem to respect the substepping. That's all I meant in the original post.

Edit: see attached screenshot - something like that.

mrice
Another question, I had assumed that I could use several nodes to manipulate a field and wire them into a merge, and that each operation would be performed left to right, but now I'm not so sure. Is that correct?
That's generally correct, but the trick is that it's just related to the order in which you originally connected them to the merge. The best way I've found is just select the Merge node and look at the order of the input nodes as they're listed at the bottom. Then drag and drop those nodes until they're in the order you need.

Good luck

Attachments:
gatheringVOP.png (33.4 KB)

User Avatar
Member
793 posts
Joined: April 2020
Offline
Hello Michael,

Here is a screen shot of my dop net. I have underlined the merge nodes in red. For now I am adding all the fields on the left side. This is better done using “gas match field:” micro-solvers, but I have not found a way to show those fields easily.

Cheers,
Koen

Attachments:
net.jpg (29.0 KB)

User Avatar
Member
89 posts
Joined: April 2008
Offline
Thanks John and Koen, got it working. I wasn't multiplying by the timestep.

I have to use large blur values to make the sim stable, which limits the control alot. So I'll have to experiment with using Koen's method (using a ramp to remap a fog volume) or come up with a different blur profile.

Best,

Michael

Attachments:
gather.jpeg (2.8 KB)

User Avatar
Staff
823 posts
Joined: July 2006
Offline
mrice
Thanks John and Koen, got it working. I wasn't multiplying by the timestep.

I have to use large blur values to make the sim stable, which limits the control alot. So I'll have to experiment with using Koen's method (using a ramp to remap a fog volume) or come up with a different blur profile.

Best,

Michael

Nice work. If by “stable” you mean the smoke seems to be sort of tearing and aliasing when you don't use a very big blur size, that's where increasing the substeps (“Max Substeps” on the Smoke Solver) can help. I also tended to animate the amplitude of the driving force from zero up to whatever my desired value was over 50 frames or so. If you do this with the Scale Force parameter on a Field Force DOP, make sure you set it to “Set Always”.

But in general, yes, the Gas Blur node just doesn't give enough control over the shape and size of the Guassian filter to work as described in the paper.

In my very early experiments now that I'm back in front of Houdini, I'm finding I like the look of the sim with the blurred goal, but the control of the SDF approach. So maybe some combination of the two?
User Avatar
Member
793 posts
Joined: April 2020
Offline
I tried a “real world” example lat week. Where in the test cases I was multiplying the gather term by 1e-5 to keep the solution stable, I found that when using the geometry of a man in stead of the text, and a source at the bottom of the grid, using 0.5 got me decent results. Not sure why, I'll do some more tests. perhaps sub-sampling would be a good idea for that setup.

The funny thing is the sizes weren't that different. The man was about twice the size of the text I used while developing.

The results do look interesting though (just not what I wanted :-) )

koen
User Avatar
Member
31 posts
Joined: Nov. 2006
Offline
Hi guys, i'm beginner in houdini and i have question about operator named ‘compute_goal_gradient’ how did u create gradient ? i mean which operator can do that ? i know that Gas Analysis can compute gradient, but is it correct in this case ?
User Avatar
Member
793 posts
Joined: April 2020
Offline
Hello,

That is exactly it. The compute_goal_gradient node is a “Gas Analysis” operator set tot analysis: gradient.

Cheers,
Koen
User Avatar
Member
10 posts
Joined: June 2009
Offline
Could you post a simple example file to show us the workflow?Thanks very much.
User Avatar
Member
12 posts
Joined: Nov. 2008
Offline
Hi all,

just tried this effects, and it works. well, Victor was right about trying it for yourself, to make you sit and think. I thought I was lucky enough to find this working, but not sure whether it is the right way or not. But yeah for some people who are new to Houdini it is gonna be a nightmare as it is so many nodes to try. Anyway, I post the file. Have fun!


Thanks,
Shandy

Attachments:
Shandy_test.hipnc (613.5 KB)

  • Quick Links