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

[Feature Request] Decoupled Baking (bake fluid, mesh, whitewater separately)

Open rlguy opened this issue 7 years ago • 2 comments

This is a feature that has gotten a lot of requests during the beta and many more since the release on May 1st!

This feature would separate the fluid simulation stages into separate baking operations:

  • Fluid Particle Simulation - Simulate just the fluid particles. The user would also be able to re-simulate the particles starting at any frame during the simulation.
  • Mesh Generation - Generate the surface mesh from the fluid particles. This stage would require the Fluid Particle Simulation stage to be simulated as a prerequisite. The user would be able to select any frame range to mesh/remesh.
  • Whitewater Generation - Simulate just the whitewater particles. This stage would require the Fluid Particle Simulation stage to be simulated as a prerequisite. The user would also be able to re-simulate the whitewater particles starting at any frame in the simulation.
  • Bake Everything - This will be the same as how the addon bakes now. The user would be able to go back and remesh and resimulate whitewater if needed. Or rebake starting from any frame.

This is a feature that I have been putting a lot of thought into and am quite excited to get this implemented into the addon. This is quite a large feature to add, but I think that addon is currently in a state where this is the right time to begin work on adding this feature. It will be much easier to add this feature now, rather than later after other planned features are added.

Notes

  • Decoupled baking will require much more data to be saved to the cache. For large simulations, the caches will become very large. The largest piece of extra data will be saving the fluid simulation particles. Extra data will also need to be saved for the whitewater particles.
  • Due to the larger cache requirements, decoupled baking should be optional. If decoupled baking is disabled, the addon will bake how it does now and will not save extra data to the cache.
  • There should be a cache operator to delete all extra data. Once the user is satisfied with the entire simulation, this operator can be used to free data that will no longer be needed.
  • Decoupled baking will require better control over how simulation settings/meshes are exported/re-exported. The way these settings/meshes are exported should be redesigned for a better workflow. There should be separate options/operators for re-exporting domain settings (fast), and re-exporting animated meshes (slow for complex meshes). Exporting settings and meshes should be decoupled so that when a simple simulation setting is updated, animated mesh export does not need to be re-run.
  • Consider adding options/operators for compressing the simulation cache (#325).

If you have any thoughts on this feature, feel free to comment!

rlguy avatar May 10 '18 19:05 rlguy

I would like to be able to render FLIP particles. For FLIP particles to be on par with White Water particles. This will allow rendering such videos with particles: https://vimeo.com/102554547 That is, you need to make sure that each stage of baking can be rendered.

PavelBlend avatar May 23 '19 14:05 PavelBlend

It will be possible to render all stages of simulation when this feature is finished. The plan is to implement the FLIP particles similar to the whitewater particles with a percentage slider for the amount to display and settings for particle object/icosphere and scale.

Edit: I'll add some info on the current progress of this feature here:

Decoupled baking progress

I don't have an estimate at the moment for when the decoupled baking feature will be finished. This is quite a large feature and required a lot of changes to the code. These code changes have been developed alongside other features during the last year of development. The feature won't be all available at once, but will trickle out as groups of smaller features.

Here is some information on what changes we have been making to support this feature:

  • Version 1.0.4: The mesh generator was rewritten to improve performance and accommodate for features we would need while implementing the decoupled mesh generator.
  • Version 9.0.5.0 (experimental): Simulation solvers and much of the fluid code went through a large re-write to improve performance for when fluid simulation will be separated from mesh generation and whitewater simulation.
  • Version 9.0.5.1 to 9.0.5.3 (experimental): Due to the large re-write, there were a lot of bugs introduced and these versions involved fixing/testing/modifying methods to resolve these bugs.
  • Version 9.0.5.4: The caching and mesh/settings export system needed to be rewritten to accommodate for the decoupled baking feature. This feature included the first visible component of the decouple baking which is the ability to save the state of a simulation and rollback to resimulate from a previous frame. This version also includes performance improvements to the whitewater generator for when whitewater will be simulated separately.

Here is some information for what will come in future updates that will be a part of the full decoupled baking feature (in general order of when they will be added):

  1. Functionality to simulate without mesh generation and visualize/render just FLIP Particles. This includes re-simulating frame ranges.
  2. Functionality to run only the mesh generator which will convert the FLIP particles to a mesh. Including re-meshing frame ranges.
  3. Functionality to run only the whitewater simulator which will use the motion of the FLIP Particles to generate whitewater particles. This will include re-simulating frame ranges.
  4. Performance improvements. Users with highly threaded CPUs and a lot of RAM (Xeon/Threadripper hardware) can benefit from decoupled baking. For example, multiple frames could be meshed simultaneously. We would like to add specialized optimizations for this situation.

Development on this future might halt for the near future. I want to wait until Blender 2.80 is officially released (July 2019) to continue working on these features. There will be some differences in how decoupled baking is implemented between 2.79 and 2.80 and want to make sure 2.80 is solid to avoid rewriting features.

For the near future I will be focusing mainly on implementing force fields into the simulator. This is the most frequent request.

rlguy avatar May 23 '19 15:05 rlguy

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

The purpose of the FLIP Fluids GitHub issue tracker is for issues and bugs only. Feature development and requests are handled internally and requests can be made through alternative channels. See: Guidelines for Feature Requests.

Just adding a note: this feature has been moved to a new simulation engine project that will eventually replace the FLIP Fluids addon as a free upgrade.

rlguy avatar Feb 22 '23 19:02 rlguy