2D Water mirror Shader?

Hi there…

I´m looking for a ready shader/someone who can make such a shader for my 2D RPG.

I´m using Uni2D for mapping and its Bone System for character animation. Each character is made of 12 Sprite Parts, connected and animated with uni2D Bones.

What i need is a Water shader, that mirrors the Sprites (inclduign animation, refraction and cut off when swimming…etc).

Example montage:
1350989--66504--$2D Beispiel.png
(left = what it currently is, middle/right = what i want)

The Shader should mirror and refract objects or parts of it that are in a specific range above the water. My Maps are planar on XZ (tile based - only water is a single plane with texture). Characters and Map Objects are on higher Y layers to simulate 3D Space (walking behind trees…etc)

Does someone know a shader to do such a mirror water? Or can do it?

If you have pro, save your cameras image(except the water mesh) to a render texture and just project it on the water mesh itself.
If no pro, duplicate your objects which are supposed to be mirrored horizontally and show them whenever they are close to the water.

I’d suggest you the latter even if you have pro. It should be much faster in your case. First, get a list of objects that are visible on the screen and are close to the water (you can overestimate this, no need to be exact). Then flip each object vertically and move it so that the bottoms are touching with the original one. What you do next depends on how you store the location of the water tiles. You’ll have to blend these objects in a shader the same way you blend your water.

You would need to have extra or duplicate objects as the other posts suggested. The problem in 2D is you can’t just render from another perspective.
Actually you can create extra sprites which do show the down-side of the objects, to get a realistic effect.

How should that work? Any object has another pivot where it would be flipped so I can’t imagine how one image could solve this. Especially if objects overlap.

You might be able to do a two pass shader. One to render the sprite then a second pass that does an alpha blended flipped around a specific axis. You can use it to simulate fake shadows also by squishing it on the y-axis and blending by the alpha channel only.

To make it look nicer you can also throw in a sin deformation in the pixel or vertex shader to make your reflection move and do a fade by the y-axis.