I am making a ‘side-on’ 2d game in unity, and would like a reflected plane underneath my players for a mirror effect. I found this great shader which does the kind of thing that i want:
http://wiki.unity3d.com/index.php/MirrorReflection3
however this is not ideal for the camera that i am using as this shader takes into account the angle of the plane, so if the plane is facing the camera so that the camera can see it, the players are not reflected, and if the plane is underneath the players you can’t see it from the side.
I tried looking into RenderTextures so that perhaps i could render the camera view into a RenderTexture and flips it and apply it to another plane but I haven’t had much luck achieving it, if anyone could give me some pointers (or code samples!) it would be much appreciated
EDIT: I made a reply to this post but it said it needs to be checked by the moderator (perhaps for the picture I uploaded?)
here’s the kind of reflection I was after:
EDIT2: The attachment does not seem to be there even though it uploaded so I uploaded it to my dropbox:
http://dl.dropbox.com/u/82768555/reflect.png
That is a plane underneath the orbs/player, rotated to face the camera (it is rotated exactly 270 degrees in the x) so it is flat/straight on it’s side. I just want the top edge to reflect whats above it, I managed to edit the MirrorReflection.cs to give me something like it but the maths is far from perfect and does not work in all situations
EDIT3: here’s my edited code for the reflection:
http://dl.dropbox.com/u/82768555/MirrorReflectionTwoDimension.cs