Weekly Development Notes #13 – Visualizing Force Fields

Covering the week of March 16th – 20th, 2020.

Hello, everyone! This is Ryan and here is our 13th weekly development update for the FLIP Fluids addon for Blender! Last week’s development mostly involved improving stability and performance of our work-in-progress force field feature and catching edge-case bugs related to force fields.

In this post I’ll be covering visual debugging and our new tutorial series for Blender 2.8.

Visual Debugging

I’ve always been a huge fan of using and creating visual tools for debugging during development! I started getting interested in programming with game development and one of the best tips I read was to visualize everything you can. When working out a difficult programming issue or bug, sometimes it helps to be able to see the issue by displaying visual data on the screen. When working with computer graphics, developing visual tools to help debug problems can be incredibly helpful!

Grid and Obstacle Debugging

The FLIP Fluids addon has a few built-in debugging tools that I use all of the time, and they can be helpful to you too. In the FLIP Fluid Debug panel (documentation), you will find a few tools to visualize internal data of the simulation. The two that I use the most are the grid display tool and the obstacle debugging tool:

  • Display Grid – Enable this option to display the simulation grid within the 3d viewport. The FLIP Fluids simulator is a grid based simulator where many calculations are run on a 3d grid of voxels. A voxel can be thought of as a 3d pixel, and a size of a voxel is the smallest amount of detail that can be resolved within the simulation. This is similar to how a 2d pixel is the smallest amount of visual detail in an image. Enabling and visualizing the grid can help you understand how the grid works, how voxel size is related to resolution, and how the grid changes as you change the size of your domain.
  • Obstacle Debugging – Enable this option before baking to visualize how the simulator ‘understands’ your obstacle objects. The simulator converts your obstacle geometry into voxel data that is useful for many of the physics calculations. Obstacle geometry must be closed/watertight/manifold in order to be accurately converted into voxel data. By enabling this option, the simulator will generate a visualization of your obstacles within the simulator during baking. This can help you check if the geometry is being processed correctly.

To learn more about how to use these tools, check out the first tip in our 10 Tips to Improve Your FLIP Fluids Workflow in Blender article and video.

Force Field Debugging

During force field development, I have been creating a little tool to help visualize force field lines. This has been very useful with helping me make sure what I am programming is correct and has helped identify many bugs. This debugging feature will also be available for you to use!

Here are a few examples for how our force field debugging tool is looking during development:

New tutorial series: FLIP Fluids addon | The Complete Guide

The FLIP Fluids addon was released in May 2018 when the latest version of Blender was 2.79. Most of the tutorials in our first series are using this version and are now out of date. Blender 2.8 made a huge update to the UI and now a new series is in production!

FLIP Fluids addon: The Complete Guide – This new series starts from the beginning with a focus on all of the simulation settings, features, and how to use them in your workflow. Dennis released the second episode over the weekend. You can find these on our new FLIP Fluids YouTube channel.

Episode #1 guides you on how to install the FLIP Fluids addon or FLIP Fluids Free Trial and the basics on how to use the addon to run your first simulation.

Episode #2 is packed with useful information on the Domain, Fluid, and Obstacle settings. I suggest going slowly and experimenting as you follow along. Even if you’ve been using the FLIP Fluids addon for a long time, I’m sure you’ll learn something!

Episode 2a – Domain, Fluid and Obstacle objects

For all of our tutorial videos and community resources, you can find them on this documentation page: Learning Resources.

More Development Notes

  • Multithreading force fields – a few of the more computationally intensive force field calculations have been multithreaded to improve performance. I really wanted to get this done so that I can iterate faster during development.
  • Optimize force fields to only update when necessary – Added a system that only runs force field calculations when necessary, such as when force field settings are changed. If a force field hasn’t changed at all between frames, there is no need to run its calculations again. This system is similar to how the simulator only updates obstacle objects when they change positions and keeps track of static/dynamic objects.