0 votes

I have a game where 90% of it is water
The problem is that I have no idea how to simulate that the character floats
if someone could give me a functional idea
Thanks

Godot version v3.2.3.stable.official
in Engine by (30 points)

1 Answer

+1 vote

Rather than explaining possible approaches (hint: it's very easy with a vertex shader moving stuff up and down on the fly!), I'd suggest you read on Nathan Gordon's excellent analysis and recreation of the ocean effects in Nintendo's The Legend of Zelda: The Wind Waker.

For Godot specific approach, just look at the vertex displacement tutorial.

Now you might ask that you don't want to wrap stuff like ships with the waves and you're completely right. So rather than taking the up/down offset at the vertex's specific coordinates, only pick those at the object's origin.

by (216 points)

THX very much. I will try it

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.