How to create realistic water physics in Godot 3d?

Godot Version

Godot 4x

Question

I want to add realistic water physics like this (https://youtube.com/shorts/7G0QH2AMVPc?si=0M4TnbOE9bNL4fv0) + realistic underwater shader to my survival game.But how can I do it?

So is it still impossible in Godot? I not have much knowledge on shaders, but I think it is a type of physics example unreal engine`s fluid flux. Also I want something like this. I watched there are some issues on it, but they are 3 years ago, that are still open now like this

I mean, anything is possible if you’re willing to spend the time to make it.

What you’re talking about creating is essentially a particle simulation with a shader that creates a water-like surface from the simulation data. If not implemented correctly, such systems can be costly for performance.

Most games use a simpler approach for water because it is more cost effective for performance. The overhead created by what is essentially a large softbody is simply not worth it, and it likely won’t add anything to the gameplay beyond visuals.

If you still intend on making a water simulation, you need to implement the following components:

  • A particle simulation that takes into account the forces in fluid dynamics
  • A dynamic mesh that regenerates every frame or so based on the simulation

I have no clue how to generate a mesh from points. However, there is a good video on how to create a fluid simulation with particles from Sebastian Lague. You might find that interesting.

1 Like

Yeah I know the tutorial, but the problem was real time water simulation, like this video. Also check this. It is really too hard to make in Godot.

Yes, and the video I linked is about a fluid simulation. Where’s the issue exactly? The video you are referencing is also a particle simulation – the only difference is the density of particles and the shading that is applied.

The statement “it is really too hard to make in Godot” makes me think you actually mean: “it is not given to you in Godot”. Is that what you mean, or what’s the problem?

1 Like

If it is particles, then can you show/make that? Also for creating like unreal engine fluid flux, we need to create a shader as if my idea.

I’m sure I am capable of following the tutorial I’ve linked you but I’m not the one that wants to make a water simulation here.

With regards to creating a shader for the particle simulation (to make it look like a fluid), I’ve seen that a raymarching shader is what you would use for real-time applications. I’m not that familiar with that type of shading though so I can’t provide any advice on implementing such a shader.

1 Like