Density by inverse velocity

I find these things are easier to tackle if you focus on the edge cases. For example, what do you want the density to be when a particle is motionless? By your original formula:

Density = 1.0 / Velocity.Magnitude (ie. Density = inverse Velocity).

If the particle has Velocity 0, you are going to get 1.0 / 0 = Infinity which Krakatoa isn’t going to handle particularly well. In particular, as the Velocity approaches 0, the Density will be getting larger and larger.

Here is an example solution:

InvVelocityToDensityKCM_example.zip (25.9 KB)

Auto-gain in fusion searches each pixel for the maximum value, then divides the entire image by that maximum value in a second pass through all pixels. There is no mechanism in KCMs for this, so you need to pick a maximum value yourself.