Proper Shoreline Material

I’m trying my hand at creating a proper shoreline material, I have no experience with the math behind FFT simulations and et cetera, I’m going for something a lot more simple, yet something no one else has managed to do, and release.

I’m trying to do something similar, if not, exactly the same as this. UE4 Water / SandBeach WIP 05 - YouTube

The man vanished from the forums around 3-4 months ago, and hasn’t been seen since, likely because the idea is dropped all together, and his work wasn’t documented or uploaded to github, to my knowledge.

Starting off, I’d like to know how he managed to ‘spawn’ waves close to the shore it’s clearly a material method, as there’s no blueprints going on.

I’m /NOT/ trying to create edge foam, or anything similar, I’m creating the waves that break onto the shore, and roll back out to sea, no one has done this yet, and fully released it. The benefit of this thread is, the work is documented, and released even if unfinished, so that everyone else can continue the project if I vanish / or someone else vanishes after its taken over.

I hope atleast, that it will get enough attention to become that popular, but I’m not sure how interested people are in having properly rendered shorelines.

1 Like

The only method I can think of, for ‘spawning’ waves at the shore, is using a texture panner, and maybe something to do with world position, to have the texture pan only at a certain place.

Panners are definitely used, as he mentions moving and masking textures, as his first method.

I’m sure someone out there has the interest to get this thing moving, I have the interest, but lack the knowledge, most of the work I do with materials is hit or miss. Learning only by experimentation.

As of 4.12 or 4.13, landscapes generate a distance field that you can just query from the material to determine how close you are to the shore. This should let you add in a panner node in tandem with the known distance to accomplish what you’re going for.

As I said before, I’m very limited in my understanding of materials and finding values. Could you please elaborate on how I’ll find the distance field value? Plug a distance field node into WPO?

So from what I gather from your post, you’re telling me to go about masking the area, the same way you would when trying to create edge-foam.

With that step done, what’s next? I can’t just tag a texture in and hook it up to a panner, that texture would play over the entire area, what I want it to do is move like in his video.

Unless there’s a way to now split up that mask into several different parts, where the waves and foam move into shore, I’m stumped.

Here’s what I have so far.

bump for interest

What I’m trying to figure out atm is how to displace only the masked area of my ocean, I want 0 displacement on the outside, or atleast a hell of a lot less, I can’t figure out how to make my displacement follow the distancetonearest node mask. Please help?

There might be some tips here:

There’s nothing there that talks about masked displacement.

Perhaps using flow maps based on the distance fields for a dynamic solution to make the stuff move towards/away from the shore. I’m terrible at the stuff though, still trying to figure things out myself.

Although I’m not using displacement in any way, I have a one-way wave moving away from stuff using flow maps and distance fields.It looks terrible still, but hopefully I’ll have more time to spend on it soon and i’ll be testing with displacements.

I understand the flowmap is a mask, but how is it possible to see where the specific places are waves will form ( aka, near the shore?) And how do I tell those specific places to use a certain displacement texture?

I thought you were looking for how to do the displacement in the right direction, which is precisely what that article answers. Throw a Sine wave in what you’ve got and you’re nearly there. Also you appear to be missing a clamp.

I am, but the displacement sequence isn’t just tossed in there with a mask.

I’m following in the footsteps of a guy called Fewks, he made one of the best shorelines I’ve ever seen in Ue4 and Cry. So the thing about his surface, is that there wasn’t any complicated math in it whatsoever, until he added it. Which means, there’s another way about this.

So what I want to know specifically, is how I get my waves to spawn in a similar, or exact same sequence as his? One after the other, breaking beside eachother, never one wave behind another, like gerstners for example.

Watch the video example, and notice the horizontal spacing between the waves. How?

ALSO. What am I not explaining properly?

The main thing is, the guy had a months knowledge of UE4, mostly in the material shader side of things… I have much more and I can’t figure out how to spawn waves very far spaced out, they always end up covering the entire mesh, and they’re not spaced.

The idea I had was using the distancefield for masking, ie telling it where it should appear and where not.

But after reading this guys comments, his waves were only traveling in a single direction and did not rotate around objects like dynamic flowmaps could supposedly do.

You could also take a look how the displacement is performed in the community ocean and weather project here.

I want to achieve his results the same way he did, and then work from there on wards, so a single direction for the waves is fine for now.

My main focus is getting a single wave that takes up a tiny portion of the screen to form BY its self, within a mask around the shore. This project might just die, because no matter how hard I tried the past 3-4 days, I learned nothing and achieved nothing.

I’m pretty well aware how they work. They do their displacement with math, Fewks doesn’t, or didn’t.

This is the sort of thing I want to eventually achieve, but with higher quality, and better wave movement.

Notice how the waves spawn by the shore, and they’re layered?

They even wash up over the shore, but there’s no images of that, just a video.

Now obviously, this was done in Unity, so there’s differences, but the general principle should still be the same.

Is this what you´re looking for?
(just a simple test material)

First off, I REALLY appreciate you took time out of your daily life which is probably very busy to do this for me, this is EXACTLY what I was looking for.

Second, I really appreciate not only have you helped me, but you’ve basically shown me he how to do it myself.

Third, the only thing I need to know now is how to split them up, and offset them in the shape of the shore, and have them become flatter as they come over the shore.

The next thing I wanna know is, does anyone know how to tell foam to spawn and follow that displacement? The ocean project did it, but I’m not sure where exactly in the material node it’s referenced.