how to make a 3D float effect

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kao_Shinpa

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

:bust_in_silhouette: Reply From: Mario

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.

THX very much. I will try it

Kao_Shinpa | 2021-04-21 16:54