Hi guys,
Basic explosion setup, we use disturbance to add high freq detail. The problem is that it's hard to dial it well when it's a single number - you want a lot of it in the start when things are too smooth, but very little of it afterwards. That leads to putting a lot of time in animating it, exposing multiple disturbances, etc.
Is there a way to drive it with the smoothness of the density field? I've tried (a while back admittedly) to make that work by computing curvature and using it as a control field, but it wasn't really working. Any better ideas?
Thanks
Pyro - disturbance on smooth density only
3219 7 1- HristoVelev
- Member
- 59 posts
- Joined: Nov. 2017
- Offline
- tamte
- Member
- 8449 posts
- Joined: July 2007
- Offline
- HristoVelev
- Member
- 59 posts
- Joined: Nov. 2017
- Offline
- lewis_T
- Member
- 234 posts
- Joined: March 2013
- Offline
- bunker__
- Member
- 21 posts
- Joined: Dec. 2008
- Offline
Hey Hristo,
not sure if that answers your question but you could try applying disturbance only on the outside of the smoke.
I find it easier to control that in a wrangle:
pseudo-code:
-keep voxels outside the smoke
-keep voxels that move fast enough
-create 1D noise (with divscale), if above thresold: create 3D noise
-add to vel
The noises are really basic and quick to compute, just cubes, no smoothing...
Also that way, I'm only adding noise to some percentage of the voxels
eg: if noise_threshold=0.99, only add noise to 1% of the voxels.
it looks a lot more natural, not just adding noise everywhere
... and you can adapt the code to use any mask easily too!
example attached, hope that helps
not sure if that answers your question but you could try applying disturbance only on the outside of the smoke.
I find it easier to control that in a wrangle:
pseudo-code:
-keep voxels outside the smoke
-keep voxels that move fast enough
-create 1D noise (with divscale), if above thresold: create 3D noise
-add to vel
if(f@density<chf("density_threshold")){ float speed = length(v@vel); if(speed>chf("speed_threshold")){ // 1D noise vector hvec = (v@P + chf("divscale"))/chf("divscale"); float r1 = float(random(hvec+@Frame+chf("seed"))); if(r1>chf("noise_threshold")){ // 3D noise vector hvec2 = (v@P + chf("divscale"))/chf("divscale"); vector r3 = (random(hvec2+@Frame+123+chf("seed")))*vector(2)-1; v@vel += r3 * speed * chf("disturbance_amount"); } } }
The noises are really basic and quick to compute, just cubes, no smoothing...
Also that way, I'm only adding noise to some percentage of the voxels
eg: if noise_threshold=0.99, only add noise to 1% of the voxels.
it looks a lot more natural, not just adding noise everywhere
... and you can adapt the code to use any mask easily too!
example attached, hope that helps
Edited by bunker__ - May 6, 2022 00:48:36
- HristoVelev
- Member
- 59 posts
- Joined: Nov. 2017
- Offline
- HristoVelev
- Member
- 59 posts
- Joined: Nov. 2017
- Offline
- HristoVelev
- Member
- 59 posts
- Joined: Nov. 2017
- Offline
@bunker
I started implementing this, in the most basic way first, and it worked immediately - just a random, adding to v multiplied by the random mask for voxel distribution you suggested, amount, and speed. It is extremely simple, looks great and seems robust at different speeds. Doesn't need control fields etc
Vex is super simple:
Attaching a preview gif.
bunker__
Hey Hristo,
not sure if that answers your question but you could try applying disturbance only on the outside of the smoke.
I find it easier to control that in a wrangle:
pseudo-code:
-keep voxels outside the smoke
-keep voxels that move fast enough
-create 1D noise (with divscale), if above thresold: create 3D noise
-add to velif(f@density<chf("density_threshold")){ float speed = length(v@vel); if(speed>chf("speed_threshold")){ // 1D noise vector hvec = (v@P + chf("divscale"))/chf("divscale"); float r1 = float(random(hvec+@Frame+chf("seed"))); if(r1>chf("noise_threshold")){ // 3D noise vector hvec2 = (v@P + chf("divscale"))/chf("divscale"); vector r3 = (random(hvec2+@Frame+123+chf("seed")))*vector(2)-1; v@vel += r3 * speed * chf("disturbance_amount"); } } }
The noises are really basic and quick to compute, just cubes, no smoothing...
Also that way, I'm only adding noise to some percentage of the voxels
eg: if noise_threshold=0.99, only add noise to 1% of the voxels.
it looks a lot more natural, not just adding noise everywhere
... and you can adapt the code to use any mask easily too!
example attached, hope that helps
I started implementing this, in the most basic way first, and it worked immediately - just a random, adding to v multiplied by the random mask for voxel distribution you suggested, amount, and speed. It is extremely simple, looks great and seems robust at different speeds. Doesn't need control fields etc
Vex is super simple:
vector disturb = random_brj(@P,int(@Frame)+12312);
disturb = fit(disturb,{0,0,0},{1,1,1},{-1,-1,-1},{1,1,1});
float distrib = random_brj(@P,int(@Frame)+14545);
distrib = chramp('distrib',distrib);
float mask = length(@vel)*distrib*ch('disturb');
@vel+=disturb*mask;
Attaching a preview gif.
Edited by HristoVelev - June 10, 2022 20:03:29
-
- Quick Links