0 votes

I added area and calculate Archimedes Force and change state if player inside that area, so we can swim.

But how to render a water in that area? Can you give me some tutorial how to correctly implement water in 3d game?

in Engine by (246 points)

2 Answers

+1 vote
Best answer

If performance is your goal, you could make a simple but fast water material using SpatialMaterial:

  • Create a MeshInstance with a new PlaneMesh.
  • Create a new SpatialMaterial in the MeshInstance's material override.
  • Set Albedo to a dark, translucent color.
  • Set Roughness to 0 and metallic to 1.
  • Use a normal map texture that represents some waves.
  • Optionally, you can enable refraction to distort what's below the water.
  • Optionally, you can enable Proximity Fade to make water edges fade in smoothly. This is only supported when using the GLES3 renderer.
  • Create an AnimationPlayer node and use it to animate the SpatialMaterial's Uv1 offset property. This will make the texture scroll over time.

To make waving water, you'll need to write a vertex shader though.

by (9,644 points)
selected by

Thank you. I will try at evening

0 votes
by (578 points)

Wow! Looks amazing! I will learn the code, thank you.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.