bullet time, "matrix effect"
48490 41 6- koen
- Member
- 792 posts
- Joined: 4月 2020
- Offline
- koen
- Member
- 792 posts
- Joined: 4月 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
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
- johner
- スタッフ
- 823 posts
- Joined: 7月 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
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
- koen
- Member
- 792 posts
- Joined: 4月 2020
- Offline
- koen
- Member
- 792 posts
- Joined: 4月 2020
- Offline
- johner
- スタッフ
- 823 posts
- Joined: 7月 2006
- Offline
- koen
- Member
- 792 posts
- Joined: 4月 2020
- Offline
- mrice
- Member
- 89 posts
- Joined: 4月 2008
- Offline
- johner
- スタッフ
- 823 posts
- Joined: 7月 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
- koen
- Member
- 792 posts
- Joined: 4月 2020
- Offline
- mrice
- Member
- 89 posts
- Joined: 4月 2008
- Offline
I'm trying to follow this but I have hit a wall trying to get the “gathering” to work.
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
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
- johner
- スタッフ
- 823 posts
- Joined: 7月 2006
- Offline
mriceThe 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?)
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.
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.
mriceThat'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.
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?
Good luck
- koen
- Member
- 792 posts
- Joined: 4月 2020
- Offline
- mrice
- Member
- 89 posts
- Joined: 4月 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
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
- johner
- スタッフ
- 823 posts
- Joined: 7月 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?
- koen
- Member
- 792 posts
- Joined: 4月 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
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
- bareya
- Member
- 31 posts
- Joined: 11月 2006
- Offline
- koen
- Member
- 792 posts
- Joined: 4月 2020
- Offline
- zzhj
- Member
- 10 posts
- Joined: 6月 2009
- Offline
- sanlin
- Member
- 12 posts
- Joined: 11月 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
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
-
- Quick Links