[Soc-2016-dev] Weekly Report #03, Mantaflow Liquids

Sebastián Barschkis sebbas at sebbas.org
Sat Jun 11 19:33:18 CEST 2016


Hello everyone,

here is my report for this week:

https://wiki.blender.org/index.php/User:Sebbas/GSoC_2016/Reports/Week_3

And here is the clean version without links and images:

= Week 3 =

My main task this week was to examine the pointcache which currently only stores
and refills smoke grid data. I figured that since smoke and liquids are so
similar (last week I decided to merge them into one single modifier for that
same reason) their cache files should be treated equally.

=== What's been done ===

* Although they're similar, I needed some way to distinguish smoke and liquid
setups. This is important for later setting domain parameters but also because
of the different file formats: liquid simulations store surface data in .bobj.gz
files, smoke volume data is stored in the Blender specific .bphys pointcache
file format. 
So I added some flags to account for liquid setups and made my Mantaflow script
setup more modular (e.g. a plain Mantaflow solver object can handle smoke and/or
liquids).

* The next step towards liquid caching was to write the liquid surface files to
the correct location on disk. Here, I was able to reuse the smoke cache
structures. That is, I reused the smoke cache GUI and all the logic behind path
parsing and custom file names. 
All in all, liquid cache writing works now.

* Finally, after writing one needs to be able to read the cache. And this is
where I am currently at. So far, I found that I might be able to reuse the
Elbeem .bobj.gz read function.

* Last week I re-enabled the smoke simulation functions. This week I noticed
that the high resolution smoke did not work anymore. The problem was a missing
liquid inflow grid for high resolution (classic NULL pointer ...). So I added
that grid and also think it should come in handy when implementing a high-res
liquid option.

* I took a closer look at sampleLevelsetWithParticles() from the Mantaflow
source code to understand how particles are sampled. While the randomness and
discretization factors play a role (see last weeks report), the values from the
phi grid do as well. So instead of filling the phi grid with -0.5 for every
point inside the mesh, one can use the distance to the mesh surface. 
I tried that approach, but found it produced less accurate meshes (see images).
Thus, for now I will keep using my old approach.

=== Next up ===

* Get the liquid cache read mechanism working.

* Finish the video comparision I proposed last week. I need the cache reading
to work first so that I can create comparable Mantaflow and Elbeem scenes. In my
previous videos I always sideloaded the liquid surface files (don't need to test
that again). 

=== Questions ===

* Discuss sampleLevelsetWithParticles() with my mentor. Is interpolation the
problem for less accurate meshes (especially on low-res grids)?

Best wishes,
Sebastián



More information about the Soc-2016-dev mailing list