Physical Ocean Surface - Developing a Realistic Water Shader

very very impressive !

Are you calculating buoyancy force using water volume displacement or hydrostatic pressure?

I’m using volume displacement. The depth is calculated at a number of points (four per box in my latest video), and for each depth value the resulting buoyancy force is calculated.

Are you almsot done with this?

This is a quick demonstration of buoyancy for boats.

For this video, I have adjusted the water material parameters (no recompiling of the shader needed) to a different art style that makes the screen space reflections visible. If you look carefully, you can see the SSR and the shadow of the boat on the water. The scene runs at 60 fps and will be inclueded in the package on the Marketplace.

watch?v=GpliyKYKypg

The following steps are needed to set everything up:

  1. Add boat static mesh to level
  2. Set static mesh actor to movable
  3. Add Buoyancy component to the static mesh actor
  4. Adjust the settings of the Buoyancy component according to your needs

Here are the settings I found:

Buoyancy Mode: AutoPoints (Automatically generates an array of points where the water depth will be evaluated)
PointsShape: Ellipse (The automatically generated points will have an elliptical shape matching the length and width of the boat)
PointsScale: 0.7 (Shrinks the points array a bit because we don’t want points far out at the end of the mesh, for example directly under the tip of the boat)
N Points X: 3 (Number of points in radial direction)
N Points Y: 8 (Number of points in tangential direction)
Float Height: -10 (this is used to adjust how deep the boat is submerged)
N Points Per Frame: 19 (The total number of points is 19 (3*8 +1 in the middle) so every frame the water depth at every point is calculated)
N Points Pause: 0 (No pause, we want to update the buoyancy force every frame at all points)
Linear Damping: 3.0 (With this you can adjust the rocking motion of the boat)
Angular Damping: 5.0
Drag Multiplier: 10.0 (This parameter controls how much the boat is dragged horizontally my the horizontal water flow)

That is very cool, gg for the hard work :wink:

Here is the same scene, but with the surface look from the previous videos:

i can wait to have it :slight_smile:
i hope i can integrate it in time to my project…

Very good work !

Stunning work, well interested in this :slight_smile:

where the link download,?
you add to marketplace for free to use?
free please and we gift you click pay to donate

@… any more progress bro? looks great… the buoyancy looks great…

Any way to have localised Buoyancy so we can have lakes/ rivers at different heights to the ocean?

We realy need to see this with a landscape. Thats the most hardest thing there is with water. So pls :3

Multiple water planes are supported already, although I have not tested this case a lot. Buoyancy with multiple water planes at different heights does not work out of the box (yet). You would have to provide the information on which plane the object is floating, and add a vertical offset according to that. So I would say possible, with a little manual effort.

You mean shorelines? I haven’t done shorelines yet, it would delay the initial Marketplace submission quite a bit.

I’ve finally finished implementing the last big feature for the initial Marketplace submission. It is now possible to select different values for wind speed and fetch length directly in the properties of the WaterManager Blueprint. Currently there are 10 different wind speeds and 7 different fetch lengths available, this makes 70 different sea states.

I’ve also managed to drastically reduce the number of Gerstner waves that are summed up. For all the previous videos, 170 waves were summed up. Now I’ve found that I can get away with 100 waves while maintaining the same quality. This improves GPU (shader) and CPU (buoyancy blueprint) performance a lot. I will probably also include a version of the material with about 70 waves.

Here is a preview of some interesting combinations. Fetch length is the length of water over which wind has blown. So if you have a lake with a diameter of 1 km, the maximum possible fetch length is 1 km, a better value would be 0.5 km. A small fetch length gives you small, high frequency waves. A large fetch length of a few hundred km gives you large, low frequency waves that can only develop in the open sea, not in small lakes.
The cubes have an edge length of 30 cm.

I’m now busy with cleaning up the project and preparing the Marketplace submission. I’m planning to submit it in January if all goes well.

The deep ocean effect and color is really nice, but I’m curious to know if you’ve put any work into how it looks/acts along a shoreline and in shallower water. Will this shader only be used in deep ocean environments?

I am also interested in shoreline interaction as I will need a convincing look for my game. If shoreline interaction is planned I will hold off purchase until it is included. Will be an instant purchase then because, as I’ve mentioned before I’m an experienced sailor and the ocean movement is spot on perfect. Very well done.

Could shoreline interaction be offered as staged levels of complexity with trade offs on visual quality?

Regards

Slinky

Right now, the whole water plane can only do one sea state. This can be a deep ocean environment, or small waves close to the shoreline (use a small fetch length). But it can’t to the transition between the two right now. There is a way how the water depth can be included in the Gerstner equations, it might be possible to use that to get good looking shore line water motion.

How should shoreline interaction work? Do you want to be able to paint the water depth? Should the water automatically react to the shoreline mesh?

Hi. I plan on building a rocky shore from meshes and having beaches from landscape actors, so an automatic interaction would be preferable.
Slinky

It would look at least partly like this, but yours has heavy patterns and it looks like your moving the bumps with a panner. And the Object look like they would lay on the water, not swim in it. Do some depth and refraction water has opacity.