Distance Field Flow Map

I’ll see if I can wrap this up into a meterial function and post it here. I might call them DistanceAO (inclusive) and DistanceAO (exlusive) although the exlusive is not exlusive at all but nearer to the goal of getting occlusion from other objects.

Oh yes, pretty please! If you can manage that, I’ll ehm (sorry, no babies arriving anytime soon) water my plants? :o

Hi, great material, it looks really good. However, when I downloaded it and tried to use it I didn’t get nearly as good results as you’re getting. The water seems to flow toward the objects, also I’m getting around 6 fps from around 40. Do you have any idea what’s gone wrong here? Thanks.


I had to change a few things in the material because the foam texture and DirectionToNearestSurface became unlinked.

I’m using 4.11.2 if that helps.

I don’t suppose anyone has the zip file from the first post? The link is dead unfortunately.

Quote from the OP:

this is truly great, would you mind sharing the math or nodes of this? :wink:

Hello everyone, I’d like to share my attempt at merging all the things I’ve read about this material.
I think the result is pretty good!

Result:

This is the blueprint. I’ve put as many comments as possible to make it more comprehensible to everyone:
https://blueprintue.com/blueprint/2y3v8406/

For the less experienced: remember to set these properties:

NOTE: There is only 1 custom function that is needed to create a gradient to mask the borders. It’s called “Symmetric_Gradient”. Here it is:

You may notice I’ve tried to implement the vertex color override for the flowmap, but I’ve dropped this material it due to other work…

If you guys want to improve from this, I’ll be happy if you shared it with me! I’m still a noob! :slight_smile:

Cheers

1 Like

man that material! :cool: ,but too complicated material for me…

I’d just like to replicate the simple curvature for my project. If anyone has that available as a simple material node screencap or copy+paste node graph, much would be appreciated. It doesn’t need to be perfect, just something to bend the water around objects jutting in.

This is my version of Distance Field Flow Map.
I use a spline blueprint to create the river.
The material has a debug option to visualize the distance field water influence, shown at the end of the video.

Grab the simplified project (UE4.13, 900MB) from here Dropbox - River_4.16.zip - Simplify your life
(the original project has 4 GB)

Mars007 thanks so much for sharing your version :slight_smile: it looks very nice. also thanks to Edoartworks and Roel for this awesome material

This is really amazing- awesome learning resource!! Thank you :slight_smile:

Any idea why it seems the resolution seems out of whack for my field flow map? I migrated the assets into my project from the simplified project file that @Mars007 posted above. (Thanks btw)

I don’t have much knowledge on how this all works so I can’t possibly troubleshoot the issue, even though I’ve tried everything in the river BP and modifying the static meshes to figure out what the issue is. It seems to be connected to the shadow resolution of the static meshes though.

Hi. Any updates for this? Looks fantastic and will be much needed.

link in #69 post

I tried to migrate this into a 4.18.3 project but it appears all those collisions are disabled? I just get a normal water texture? What’s going on here?

Edit 1: I upgraded to project to 4.18.3 but it appears half of the foam is missing, I’ll investigate this as it looks a little weird check out picture 1.

Edit 2: As you can see in picture 2 I have copied and pasted this into my other project and I’m getting nothing, I do have real time lighting implemented, so would this have anything to do with it? I noticed a basic cube in the scene is BRIGHT.

@Frostydowns , I’m getting the same issue as you after I migrate it to a project in 4.19.1. The original project does work correctly though (in 4.19.1) before I migrate it, so it seems like something gets lost during migration.

Anyone have any ideas about what might not migrate correctly?

For reference, this is the MI_FlowingWater2 material comparison:
Left: after migration (and a few minor tweaks)
Right: Original, before migration

Clearly, the white circular area in the original is the foam disturbance or whatever we should call it.

I am making waterfall in distance from object (something like background) Is it better to use animated cube map or to model waterfall ?

Here’s to hoping this thread isn’t dead.

Could someone help me really understand the math behind everything here?
I constantly get strange results. I can visualise the DistanceFieldGradient and the 0-1 gradient but can’t figure out how to correctly use them to distort my texture.
The SimonSchreibt tutorial helped my understanding of flowmaps a lot but I can’t put it to practice with the Distance Field generated one.
I did indeed enable Generate Distance Fields in the project settings before anyone asks =p
Example of strange results I get (texture is a placeholder I found online):

all files are down, is there a way i can get one of those?

i want to study this too!

1 Like