I try to create a big wave ocean

Hello everyone. I need to create a large ocean that will have waves among other obvious features. However, I need the ocean to receive an elevation according to the distance. I believe that the ideal would be a huge mesh, but I know that there must be other methods of generating oceans within unreal. NOTE: I would not like to use the experimental ocean, as I have had colleagues who hace crashes error on projects because of this plugin. If possible, does anyone have another option?

Below is an idealized feature that I intend to apply to the mesh.

This is a reference to height deformity:

While these are the deformity according to the location of the object:




Basically, I take the main character’s coordinates as a reference and apply an elevation to the mesh according to his coordinates. NOTE: I am not trying to simply do common distortion in water with contact, as is the case in other games. In fact, I want to apply an effect to the horizon and for that I need the water to be elevated in the distance.

One way to do this is with a material shader:

Note that what you are asking for is quite simplistic. The material above supports only one location and has no animation. There are plenty of tutorials online about render targets and water which yield much better results but are quite more complex. (Like this one: https://www.youtube.com/watch?v=-bYVnBAvomo)

1 Like

I appreciate the logic behind applying the relief.

In terms of appearance, I already have an advanced water shader. My problem is precisely applying this elevation with a referencer. In addition to the waves…

Even if I apply this effect, I can’t imagine how to make a mesh so dense to receive the distortions

I am concerned about optimization issues and unnecessary distribution of polygons

But if the deformity system presented in the video already has an optimized application of mesh distortion, it should already be very practical for me.

Well, feel free to use that if it helps you.

For optimization you can put high resolution grid around important objects like the player and leave the rest pretty low res. As long as you manage to match the UVs and blend between the two meshes seamlessly, you are in the game.

1 Like

I hadn’t thought of that. Thanks for the advice. I’ll apply it

The most complicated part would be when moving the char on land. The mesh would have to be adapted to the location

In essence: you can’t.

Or if you do, you get either really bad results or really bad performance.

Tris count required to make something like you want possible is in the billions for it to look good, which means your secene will get 0FPS or just about.

Reducing the tris count to a reasonable value you get ok performance, and a sh*t result where the triangles are so big and awkwardly shaded that it makes you want to cry.

That said, if you dont care about looks or performance, and you have a gerstner cluster, all you need to do is apply whatever “ring” texture as an offset to the elevation before also applying your gerstner function.

Honestly, if you have an “advanced water shader” you shouldn’t even be asking these basic questions.
Sine waves get added up and then divided by the number of waves to output a correct result. In this case you are adding a straight up texture driven offset. No math involved.

Keep in mind that, Generally speaking, at a distance from player more than 30m you have LOD0s with a minimum tris count.
On a well made water sheet, that’s probably around 16 tris. Maybe 32 if you can publish only for the latest GFXs…
Due to the geometry of a properly made water sheet, the elevation with grstner on top is likely going to look rediculous.

Also keep in mind that any decent water shader will fade out the wave effect well before 30m from player, for the very same reason…

1 Like

I have 3 materials. Two were made by me but do not have mesh distortion.

The third one was from the marketplace but is extremely detailed. My focus is on celshading

My focus in this post is to try to learn how to build an optimized deformable mesh system. I want to know if there are procedural methods for deforming and adding polygons, among other things. Like in the case of Ac Black or Sea of ​​Thieves, which has a vast ocean.

The problem is that even if there are materials with waves, they are chaotic and organic. I want a directed deformity. Like in the example above

The visual result of applying this distortion may seem strange and unnatural. But the example above is just a starting point for me.

My materials:

Wave Water:

Like I said. You pretty much cannot.

Here is an example of what a proper mesh structure for an ocean looks like:

Past 30m from camera the deformation is around 1 vertex every 10/2 meters.

There is absolutely nothing procedural about it either, because for the most part you can’t.

The load on CPU/GPU makes a 4090 cook as things stand (regardless of the engine which has too lany faults to even list).
This is engine agnostic. Due to the number of tris and nature of a water sheet.

You cannot just add polygons.
If you do, you get seams everywhere - hence why there is a Correct mesh structure, and trash that people with 0 skill or knowledge try to pass off as a working mesh (epic included).

You can lessen arrifacts, but unless your mesh is specifically crafted you will still get visible seams everywhere.

Tessellation is out of the question entierly anyway, but it would also make the seams appear (and usually much worse than even a bad mesh LOD setup).

Further, Creating the mesh via procedural mesh system means means you are stuck with whatver you create - essentially no LODs for it.
On a needed density of something like 1 vert per 10cm to be able to notice ripple like interactions from a player’s movement, you essentially just bricked your CPU and probably BSOD in the process of iterating over the needed vers to create a 100m water area… ok maybe not that drastic, but 10 * 10 * 1000 is no small amount of iterations to define vert posotions. And its only CPU side since you need to create.

On the other hand, simply placing 10 x 10 meshes (each mesh being 10m^2) is near instant. Gets you the right result, and doesn’t involve any runtime stuff to waste computation on…

And that, in short, is why you dont make a “procedural” system for water stuff.

1 Like

Got it. I’ll try to reorganize my train of thought, then I’ll come back here with some ideas.

I really need the horizon to be higher than the player. It doesn’t necessarily need to be dense in my case, since the fresnel I applied already hides any visual oddities of the low mesh. It could be a ring with faces pointing towards the player, which are superimposed on the oceano.

In the end, I don’t want waves on the horizon. It’s just a ring-shaped elevation in the distance.

What is the purpose?

Would it not be a lot easier to make a circlular mesh that moves along with your player and is always present?

It would be a lot more performant, guaranteed.

You can even go with a full sphere, like the skysphere the engine used to use (not sure if thats still part of the latest versions).

It all depends on what the end purpose is.

If all you want is a way to block the horizon view, then a circular mesh with a properly made material will likely do everything you need and more than you need, without costing you much of anything.

Since it uses a flat texture, you can even animate it using UVs and a Sine Wave to give the impression that you have huge waves in the horizon with very little distortion, near 0 artefacts, and no shadow issues (disable shadows on the mesh alltogether).

You can even do complicated stuff, like only draw the ocen on top of the ocean when its present under it by using Distance to Nearest Surface, for instance.

It all depends on why you want this effect / the end goal of it (which so far is not very clear).

It’s not that simple. I thought of this as a first option, but it wouldn’t look “nice”. The effect needs to blend in with the ocean, so it’s done directly in the shader and requires the elevation of the mesh on the horizon.

I tried it here and it worked very well when applying the dZh0 logic to the mesh.

When possible, I’ll post a video presenting my project on YouTube and I’ll remember to send it here. Now all that’s left is to apply the lod generation system. My solution for density is basically for the last lod to be a replica of the third lod.

Basically there is a texture designed with the vector camera in the shader and it needs to be planned to work correctly.

To update the structure of the LODS, here is how each one is categorized.

The last one, as I said, serves as the elevation region of the horizon, so it is identical to the third lod.


You should simplyfy that a lot more.
Think in triangles not in squares.
But you have the righr baseline idea.

1 Like