Realistic Oceans Using Mesh Deformation!

Really cool. I made something very similar to this for my portfolio however it is very cool to see other options for ocean mesh deformation. Wish this was out before I took the time to create a system myself.

Couldn’t resist translating it lol.

4 Likes

Zàijiàn. Google translate for the win.

Great tutorial, looks pretty good! I’ll definately be using this.

2 Likes

I will check this out later!

Is there any function to get the wave’s height from a xz-coordinate?
This would be useful to implement custom floating.

3 Likes

Good idea! I am working on making a function where you can get the CFrame of an object as if it were floating on the wave.

5 Likes

if you look long enough into it it starts looking like some blue fleshy being that moves slowly… looks morbid O_O

4 Likes

Is it possible to create tsunamis with this? I really want to test this out!

2 Likes

I suppose it is possible, and change the steepness and the WaveLength to a higher number.

1 Like

UPDATE!

I have now added a feature where before, if you had PushPoint disabled and your Direction was Vector2.new(0,0), it would error because the wave has no idea where to go. Now, instead of erroring, it will come up with a direction on its own using the perlin noise algorithm, to make realistic waves that do not go in any one direction! See this video to get what I mean:

https://gyazo.com/f8c105a3bbd7317efb2538657d74fea8

As you can see, the waves do not go in any one direction, and should be used when you want waves going to no one place. This also includes support for multiple wave planes put next to eachother, as the direction for each point in the wave is decided based on the plane’s X and Z position, so positioning a plane next to another plane, you should see a seemless transition when using this.

6 Likes

Simply changing the .Transform property of 2 hundred bones takes about 1 ms, which is a lot of time for such a simple effect, do you have a way to mitigate this performance impact?

3 Likes

Unfortunately, there is no other way to be able to make it faster without lessening the amount of bones, making the waves look less realistic. 1 ms is about the fastest it can go, and luckily, 1 ms is fast enough to not have any noticeable performance impact when rendering the waves.

1 Like

How is 1 ms (1 / 1000 seconds), that long?

5 Likes

Thanks for making this. It will be very helpful for those of us without Blender expertise to be able to experiment with this effect.

I did a quick test of your sample place and it looks cool. I don’t think I’ll be able to use it for a flying game as the mesh render distance isn’t far enough. At a typical airplane cruising altitude the mesh will not be rendered. Also, I think it might be hard to make an area large enough to pass over so quickly(as in an airplane) and keep up with rendering the next section.

Should make a lot of boat or beach games look awesome though.

2 Likes

I’m glad you like my module!

You can change the render distance in the wave settings. And in a future update, I will make it so the character’s Y position does not get counted in the render distance. Also, to make waves render seamlessly, you can put multiple waves next to each other and use the render distance feature to only render waves that are close enough to the plane.

2 Likes

I tried math.huge. Unfortunately it looks like its not a problem with the animation, its the mesh texture render distance. At about 300 stud height, the mesh texture is made flat and all detail is removed. You can still see the wave animation paying along the edges of the wave boundary. Between 250 and 300 stud height the mesh texture reduces in fidelity until at 300+ its completely gone/flat, solid color.

1 Like

Im pretty sure you can fix this by going to the plane mesh and editing a property called RenderFidelity. It decides what happens to the level of detail after a certain distance away from the character.

I checked the sample place and the plane mesh is already set to precise, which is supposed to render the most detail regardless of distance.

This is near 300 height:

this is 300+:

5 Likes

Are you on the highest graphical setting?

1 Like

Oh that might just be the fog from the atmosphere. That’s not the mesh itself. Mess around with the lighting and fog.

1 Like

Yep

Its not the atmosphere, I deleted that. It seems that its not related to the mesh, but rather the reflection distance limit on any part surface. I added a big part with a texture and it does the same thing as you zoom away the reflection does not render(and so you lose the perception of waves and depth).

Look at the sun reflection in the first shot, then in the second screenshot it is gone(along with the wave reflections)


3 Likes

Its a limitation in the lighting technology. Your map was on Compatibility. I changed to Shadow Map and it renders the reflections up to 600 studs. Better, but still not enough to be useful for flying.

2 Likes