Water effect

2018-10-31%2000_51_47-DefoldShaders

I was messing with some distortion shaders and realized an underwater effect could be reasonably easily possible with a similar technique…

So you would draw your scene to a render target, draw your water to a render target (probably solid alpha) then clip your scene to the water alpha, then apply the water to the clipped scene with add effect maybe, then distort the new water texture, then draw it on top of the scene.

A mesh based solution would probably work also.

8 Likes

Do you have an idea on how could be the reflections in the water made? Render on two planes and the below one is upside down with a water effect? How can it be achieved?

If you want to render just something simple like the player avatar or objects you could have a duplicate sprite of your player flipped vertically to mirror the player like a reflection just below the player, and then draw that onto the water render target before it is warped.

Spelunky does a similar effect with ice https://www.youtube.com/watch?v=7fMCTVhEzmU

2 Likes

It is a very simple idea, very brilliant, though :smiley: But I think I don’t know how can be half(/some part) of the screen post-processed to have a water-like effect? Do you mean creating two drawings, one with a world, and one with a flipped “reflected” world, then post-process the second drawing with wavy effect and, at the end, add them togheter?
Or maybe something like this: https://www.shadertoy.com/view/XdKSRd ?

1 Like

[Split this into a separate topic]