Blender-FLIP-Fluids icon indicating copy to clipboard operation
Blender-FLIP-Fluids copied to clipboard

[Feature Request] Add dust whitewater particles

Open lmoschcau opened this issue 7 years ago • 10 comments

Often when a wave breaks on a sandy beach the water picks up some sand. I would love to see the possibility to generate dust particles when the fluid is moving quick enough over a surface.

This would allow much more realistic ocean waves etc. to be generated. Here are two examples: breaking waves seen from top breaking wave seen from the front

It is possible to create very realistic simulations with the flip fluid addon. But especially in ocean / beach scenes extra realism could be gained by simulating interaction with the environment.

This feature could be achieved by adding a new whitewater particle type to render and display the particles. In addition as a control object a new FLIP fluid object type could be added or just referenced in the FLIP fluid settings. The particles should have a weight and should move accordingly. In addition it would be a major advantage to control the generation of particles with a texture. If this is not possible, would it be possible to let the flip fluid act like a force field? This way it could affect particles and also other objects.

lmoschcau avatar Jul 28 '18 21:07 lmoschcau

Just to tag onto this part:

If this is not possible, would it be possible to let the flip fluid act like a force field? This way it could affect particles and also other objects.

Blender has the Smoke Flow force field that uses a specified smoke domain as a source. Being able to specify in fluid domain as a force field would be a more versatile solution than creating another particle instance within FLIP Fluids. Depending on how the force field reads in the data from the domain, it might be easier too.

vmxeo avatar Aug 10 '18 23:08 vmxeo

Although it would probably be better, i don't think it is possible to achieve this with a force field. The effects of force fields get applied in blender/source/blender/blenkernel/intern/effect.c in the function do_physical_effector. I would therefore assume it is not possible to add another force field with an addon, instead it would be necessary to completely recompile blender.

I think it would be simpler to apply these effects when baking the fluid simulation. This could be achieved by adding the objects which should interact with the fluid simulation in the flip fluid settings. It might even be possible to let the fluid get pushed away from objects.

lmoschcau avatar Dec 23 '18 12:12 lmoschcau

Here is an attempt to add dust and mist to the FLIP simulation:

https://youtu.be/N_Bx62UX7ME

To make the sand particles, I ran two different simulations - one with normal white water, and the other with just bubble particles with negative bouyancy and more drag. Each sim had its own cache name so I was able to export the 'sand' object as an alembic file and then import it back again into the normal white water sim.

In effect, the final sim had four types of white water! (I suspect both sims are not identical, but they were very close)

I think that this might be a possible though complicated solution to having ww particles of different size and mass.

Sadly, the 'sand' particles appear wherever there's turbulance. I tried making the beach object have much more white water effect - just for the sand, but that didn't seem to work well. In the end, I masked all sand particles except those closest to shore. IMO it doesn't look too bad and you can see the sand mixing with the waves a bit as they flow up the beach.

I think that to make a proper 'dust' particle, the particles would have to appear only where turbulance meets a specific 'dust' object.

The mist was derived from a smoke simulation from a very short lived particle system emitting from the spray particles.

guitartom47 avatar Mar 14 '19 22:03 guitartom47

Thanks for sharing! The result is VERY cool and helps give me ideas for how this feature could be implemented.

A dust/sand particle type could be implemented similar to the bubble particles. The particles could be generated based on turbulence and proximity to obstacles that have been marked as a 'dust/sand' generator.

rlguy avatar Mar 14 '19 22:03 rlguy

ok so i made a very rough implementation in the addon. https://youtu.be/Yplyo8ukfTs it works rather good. The simulation looks a bit basic but this is all my computer could do in a reasonable amount of time.

lmoschcau avatar Nov 07 '19 20:11 lmoschcau

Looks great! It's a nice coincidence that I was working on an area of the addon earlier today that will make this easier and cleaner to implement.

I have actually been taking a break from developing a large 'Force Fields' feature for this week and next week to set aside some time for maintaining other areas of the addon as well as adding small feature requests. I really like the idea of this feature. I'll make this a priority for tomorrow and next week's development.

rlguy avatar Nov 07 '19 21:11 rlguy

Here's an update on the feature! The implementation is near complete and my goal is to have this released in a new stable release before the end of November.

There are some new settings in the Whitewater Panel to configure dust generation:

dust_whitewater_ui

Obstacle objects have a new setting for whether they will emit dust (default = True). This setting is also available in the Whitewater Panel near the bottom.

dust_obstacle_ui

Display Settings Panel has been updated to include the new dust particle type:

dust_display_ui

Stats Panel has been updated to include data for the new dust particle type:

dust_stats_ui

TODO:

  • Test feature and find suitable default values (both UI values and internal simulation values)
  • Update Material Panel to include new dust mesh
  • Produce test renders
  • Update documentation

rlguy avatar Nov 18 '19 23:11 rlguy

This looks amazing. I'm really excited to finally see this feature in an official release. In the rough implementation I did, the dust emission on an object is controlled trough an emission strength parameter. From this a dust emission strength influence grid is generated (based on proximity to the surface of obstacles)

I'm quite new to c++ programming so the method i chose is probably not the most effective one. But I thought this would allow the user to have more control over the simulation. I don't know if it's really necessary and how difficult it would be to implement it in the new version. Screenshot from 2019-11-19 10-04-35

@rlguy have you thought about using a strength parameter? If so why have you decided against it? Just curious

lmoschcau avatar Nov 19 '19 09:11 lmoschcau

Thanks for the input! It sounds like our implementations are similar. A difference is that I am just using an on/off checkbox for the objects dust emission strength. This means the emission strength can only be 0.0 or 1.0. The amount of dust generated can be controlled globally using the Dust Emission Rate parameter in the whitewater settings.

I like your system of using a Dust Emission Strength parameter much better since it does allow for more control scaling a different emission strength for each object. It is also more consistent with the other Obstacle Property values in the UI. I've updated the implementation to use a strength value rather than an on/off checkbox.

Here's a test of a fluid flow against an dust generating obstacle: https://gfycat.com/unequaledglumkoi

And one using two obstacles with the strength parameters set at 0.25 and 1.0: https://gfycat.com/dimwittedquestionableallosaurus

rlguy avatar Nov 19 '19 22:11 rlguy

This looks extremely promising. I'm looking forward to the release.

lmoschcau avatar Nov 19 '19 22:11 lmoschcau

My apologies for the ping on this issue thread, just cleaning up the FLIP Fluids GitHub issue tracker.

This feature had been added in an earlier version to the whitewater simulation feature: https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Domain-Whitewater-Settings

rlguy avatar Feb 22 '23 19:02 rlguy