Gamer-15
Member
Hi,
I am trying to make reflections of these landscape on the water.
The problem is that the shapes have a non straight coastline (red line in figure 2 below). If it was a straight coast line the sprite could just be flipped around the x-axis. But if done on these sprites it causes bad results as shown below. I was thinking about flipping it in a shader. But I have not a clue how this could be done.
What is known is this: the coastline (reflection_y) for a given x is at the transition from pixels with alpha>0 to pixels with alpha is 0 (when increasing y). When this reflection y for given x is known, the colors of the pixels below could be calculated. But I have no idea how to implement this into shader code...
Any help is very much appreciated.
I am trying to make reflections of these landscape on the water.
The problem is that the shapes have a non straight coastline (red line in figure 2 below). If it was a straight coast line the sprite could just be flipped around the x-axis. But if done on these sprites it causes bad results as shown below. I was thinking about flipping it in a shader. But I have not a clue how this could be done.
What is known is this: the coastline (reflection_y) for a given x is at the transition from pixels with alpha>0 to pixels with alpha is 0 (when increasing y). When this reflection y for given x is known, the colors of the pixels below could be calculated. But I have no idea how to implement this into shader code...
Any help is very much appreciated.