Why is this working? (a flow map surprise)

I’ve been trying to create a dynamic flowmap for getting foam to break up from objects. I managed to get the flowmap to do what I needed, kind of, but the more I read about flowmaps the more I feel like this shouldn’t work at all.

What I originally wanted was for my foam to float into all directions from my objects similar to this this and since I’ve seen images like these, I was expecting to have to generate the whole range of colors around my objects to get it to move like I wanted, basically like the object were placed in the middle of that direction image.

After some flowmap testing I ran into an issue however where the map wouldn’t move at all if I feed it R 0 G 0 using solid colors as a source like this.

Then after more testing with distance fields, I ended up with the following image which much to my surprise resulted in the foam floating away from the object in all directions, even with just 2 colors as can be seen in this video here.

Now I just can’t understand why it keeps moving like that with just 2 colors (red at ~0.2 and black closest to the objects), here’s the blueprint (with my distancefield feeding into the alpha of the lerp).

Any clarification on why exactly this is working with two colors would be greatly appreciated.

I might also note that the “waves” appearing around the objects does not look like the black/white image that can be seen in my blueprint. It seems like it gets stretched around the objects which I find a bit weird.

Also, Am I wrong in assuming that it shouldn’t work unless I had a different color for each direction around the objects rather than just the same ones like in the screenshots above?

Looks as if one of your parameters must have some additional texture masking to alter the phase like that.

Hm,this is how it looks without any additional masking at all, it still moves away from the objects (theres also unwanted white stuff that moves in a single direction, but I filter that out with this (DF-based) mask.)

The movement of the ripples/foam, still moves smoothly around the objects even though my flowmap consists of just two colors (red/black) as can be seen in first post.

In the original post I tried to simplify the blueprint so I might have left out something important so
here’s my whole material (minus the masking from previous post and some distortion effects I used as well)

The white stuff in this screenshotis the only thing I’m wondering about, why it moves like that at all.

oh I think I see whats going on. The texture is panning just one direction across most of the surface, but due to the way you are killing the flowmap using that gradient, what you end up seeing is a mapping from a super panned offset texture to 0 distortion, which does cause it to look like its radiating outwards. This is kind of similar to the effect people get when they try to slow down a panner by multiplying time, but instead that causes a huge backwards shift in time. So you kind of are seeing all the phases in between those states all compressed into that little edge gradient.

Ah, thank you that does make sense.

I still assume that the proper way to generate moving foam/waves around objects would be to generate different colors around the object for each direction rather than the method I’m using.

Also, how accurate is the following image regarding flowmap directions?


With RGB 0 0 0, should the flow map move in opposite direction vs RGB 1 1 0?

For some reason, in my case RGB 0 0 0 simply stops any movement when using the flow_maps_simple node.

check the flowmap material function. There is a random -1 being multiplied to one of the axes which technically makes it wrong. Not sure who added that or why they randomly flipped one of the channels. Like anything, just make a test texture and see how it goes.

Hey Gmi, would you be willing to share how you managed to do this in the end?