利用者:Sebbas/GSoC 2016/Reports/Week 3
< 利用者:Sebbas | GSoC 2016 | Reports
2016年6月12日 (日) 02:21時点におけるwiki>Sebbasによる版 (Created page with "= 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 (l...")
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). (rBd3c57bc244c0, rB05c03b652628, rB836db6c99046)
- 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. (rB7abab97769c5, rB5a8340634080)
- 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.
(https://developer.blender.org/diffusion/B/browse/master/source/blender/modifiers/intern/MOD_fluidsim_util.c$163)
- 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. (rBa3c04bdd56c4)
- 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. (rBe8863f0be170)
I tried that approach, but found it produced less accurate meshes (see images). Thus, for now I will keep using my old approach. (rB0992e7f6861a, rB6c177d3d3098)
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)?