Water foam cuts off abruptly at a distance

Hi! I’m working on an environment piece in Unreal 5 for practice, and I’m running into an issue with my water. I’ve added a simple water foam effect I found to my ocean plane, which is some distance away from the main focus of the environment. The problem is that the foam is abruptly cut off at a pretty short distance. I’d like to at least be able to extend it as far as my background landscape goes.

Here’s the shader which only has the very basics just so I can make sure the foam works.

I’m still pretty new to the intricacies of Unreal and I don’t really know where to even begin investigating what’s causing this. Anyone got any ideas to fix it, or a better alternative method to achieve the same result?

I think you might have just calculated it wrong?

How far away is that? BTW, I tried it also with your code and it works ok, its just that if you want to make a foam ‘mask’ then you’ll need it from 0-1.

The environment is quite far away to be fair, added a mannequin for reference. I tried your code and it had no effect on the cutoff distance.

Something interesting is that the cutoff happens in chunks rather than at a set distance, maybe that’s helpful.

1 Like

See this post, there is a global distance

But its probably going to be a bit of an uphill struggle, as many things cutoff with distance, including shadows etc…

Increasing the global distance field view distance did the trick, thanks for pointing me in the right direction!

1 Like

It will have an impact, you might want to check out your pre and post frame rate.

Framerate is still smooth, and it’s not the goal of this project anyway. I’m only doing this for my portfolio so the end result will be a bunch of still images, though I’m still keeping performance in mind a little bit :slight_smile:

1 Like