Help to mimic pokemon emerald water ripples

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

enter image description here

enter image description here

as the 2 examples above show. I’m looking for some direction for a way to implement/mimic the ripple effect, reflection, and the “the Chowder effect”, or “the Gankutsuou effect” of the water shown in the game pokemon emerald.

my current take is that I would be able to achieve this by just rerendering a copy of the player that is inverted. and have the puddle/water texture be a cutout to a scroller background behind the texture map. not sure if this is the right approach or if there is a better way to go about this is shaders.

note: I’m not looking for this to be done for me but some helpful resource or a nudge in the right direction would be nice.

This could be achieved with a shader. How to do that, though, is beyond my skill. The shader would have to reflect the player (or at least the sprite of the player’s current state) and then apply some stretching animation. Maybe look on the Godot Shader website for some inspiration?

Ertain | 2022-07-16 05:12

:bust_in_silhouette: Reply From: Maskass

im not a pro in godot :stuck_out_tongue:
but maybe you could create a copy of the player (maybe create a new node) but with 2 animations (maybe animatedsprite child node) : 1 with the normal reflection (ur 2nd image) and 1 with the shadow in the water (the 1st image). you need the frames to be reverted compared to the player
the copy should detect when the player is on a bridge (or anything you want) so the copy would become in shadow animation, and otherwise it should be in reflection animation (as you said the water is a cutout to scroller background, so we won’t see the reflection in other places like in the grass) : maybe you can use a signal so when the player is on bridge it sends signal to the copy so the copy turns into shadow animation (the bridge may be area2d node or smth like that idk)
then you can script that copy so it will move exactly like the original player
then you put this copy as a background of the game (like a scrolling background or parallax background idk)

For those of you looking for a shader that does this, I have made one that can be found here.