Hi I have been trying to figure out flowmaps for a really long time now and I just can’t get my head round it.
In my scene I have multiple rivers flowing into each other from different directions, with canal locks, wharfs and weirs. So it’s about 2 pieces of geometry and one rendered flowmap texture. I’m using Houdini for this and it looks perfect in Houdini but when I try and bring it into Unreal Engine with the baked out flowmaps it doesn’t work. I’m using This material and I have tried using the one that comes with unreal and neither give the result that’s correct. I think the problem revolves around my UV’s as I use a Y projection of the main river, but flow maps should still work right? The flow of the river should just flow down the river using the R and G values of the flowmap, but anyway when I use this UV project I main just get the water flowing in one direction, when I pack the the geometry UV’s together into one UV they both go in different directions, but either way they ignore what I’d like them to do based on the flowmap.
Apologise for the rant, I’m really pulling my hair out over my inability to do this.
No.
The uv of the flow map is mapped to whatever UV you map it to, which is mapped to whatever the river Mesh is mapped to.
Nothing stops you from adding a different dedicated flow-map uv…
Sounds like you are either over or under thinking this.
A flow map is a static image representing the direction something is going (vector) at that specific pixel.
As such, mapping a whole river will require several tiling images, or some computational values depending on the lenght and detail required.
I have a custom system running that generates up to 8k render textures for each slice of the river/water body that sits on each map tile. And even that is way too low of a res to get cinematic like results.
Make sure you actually followed the tutorial.
Disable srgb, make sure the math is correct.
Your results have to be in a 0 to 1 range (on each channel) at all times for them to make sense.
Specifically regarding direction, you can turn results around in the material rather easily if you missunderstand the math behind it, or if you don’t know the way that the flow map program uses the color range to define direction.
It is a convention, but it is common for different countries/programmers to go with different conventions.
My advice?
Drop the texturing entierly. Use vertex colors on the mesh to define the flow map, so you can paint the flow in engine. You won’t need to worry about UVs anymore.
You loose detail, obviously, as the flow map in texture can cover all areas of the mesh, while the vertex paint can only offset the color from vertex to vertex. But it makes it much easier to get “global” effects into the flow. Also costs a lot less memory/vram.
1 Like
Hi Thank you so much for your help.
I followed your advice and exported the geometry with Vertex Colours and plugged that into my shader. Everything worked well apart from the low resolution and the red channel need flipping (so the shader works). Which is fantastic but now I’m left wondering why does the flowmap texture not work? Does the resolution really affect it that much? If I use the flowmap as a diffuse of a material for the geometry in Houdini then it looks the same as the Vertex Colours, but when I apply it as a Base Color in Unreal it’s pretty much just yellow? I have taken your advice further and exported a small section of the river and baked that out to see if the resolution is the problem, and even though it should have varying degrees of yellows reds and greens, like you see in the vertext colour and on the rendered out texture, it still appears yellow? This is not a uv offset issue or scaling problem because you can still see the tiniest amount of distortion where it’s supposed to be, but apart from that the texture still just pans in one direction
My Texture is rendered out as a colour map, srgb is turned off and it’s brought in as a vector displacement map.
Does the file look any different between the engine and the program you are using to author it?
Could be something like compression or virtual texture that’s affecting it on import/load.
If thats not it, then its just not being exported or baked cottectly in the DCC…
I figured it out.
Thank you so much for your help.
I adjusted the UV’s of the geometry that I exported so that they didn’t match the ones I used to make the flowmap. Dumb.