User:Sriharsha/GSoC2020/Final Report

Google Summer of Code 2020

Liquid Simulation Display Options - Final Report

This summer, I worked on providing visualization options for liquid simulation grids and improving fluid simulation display options on the whole in Workbench.


Work Done

Implemented and added the following to the viewport display options for fluids:

Viewport Display

  • Raw voxel display or closest (nearest-neighbor) interpolation based on the centers of the grid cells for displaying the underlying voxel data of the simulation grids more clearly.
  • An option to display gridlines when the slicing method is single.

Grid Display

  • Visualization for flags, pressure and level-set representation grids with a fixed color coding based on Mantaflow's integrated GUI.
    • Flags (mFlags)
      • Visualization of a 2D slice of the flags grid in a liquid domain. (Display Thickness used: 0.03)
      • The flags grid is an integer grid which stores the information about the state (or contents) of the underlying simulation grid cells. The color coding used for the visualization of flags is as follows (Cell Type -> Color):
        • Fluid -> Blue
        • Obstacle -> Gray
        • Empty -> Purple
        • Inflow -> Green
        • Outflow -> Orange
      • When more cell types coexist in a cell, the specified colors get added up to get the resultant color.
    • Level-set Representation Grids
      • Visualization of a 2D slice of the fluid level-set representation in a liquid simulation. (Display Thickness used: 0.02)
      • Visualization options for the grids mPhi, mPhiIn, mPhiOutIn and mPhiObsIn which contain the level-set representations for the liquid, inflow, outflow and obstacles respectively in the liquid simulation.

Vector Display

  • Made vector display options available for visualizing external forces of the fluid domain.
  • Marker And Cell grid visualization options for vector fields like velocity or external forces.
    • MAC Grid visualization for a 2D slice of the velocity vector field in a liquid simulation.
  • A toggle for scaling the display vectors (needles and streamlines only) with magnitude of the actual vectors.

Coloring Options for Gridlines

  • Range highlighting and cell filtering options for displaying the simulation grid data more precisely.
    • The cells with values of the color mapped field within the user-specified range are highlighted with a user-specified color on the grid lines to display the grid values with better precision. These highlighted cells, filtered by a user-specified range, can be further filtered based on the cell type. (Only usable when Grid Display is enabled.)
  • An option for coloring gridlines with flags.

Made various minor improvements and options for better user control over the visualization. I hope these changes helped the fluid viewport display to be more informative and usable.


Many thanks to my mentors Sebastián Barschkis, for the invaluable guidance throughout the project and Jacques Lucke, for mending my ways of coding! Thanks to Ray Molenkamp (LazyDodo) for supporting by providing the builds throughout. Thanks to the Blender community and Google Summer of Code for introducing development and collaboration to me on a larger scale. It has been an extraordinary learning experience. Thanks.