What I'm basically looking for is an effect that can distort the tiles a little bit along the horizontal plane, without getting these ugly colors on the edge of the image. It doesn't have to be a wave pattern, and I don't need/want reflections. After all, we're not looking at the surface of the water, we're seeing directly underwater. Does anyone know of a good way to do this?
Code: Select all
function setupShaders()
distortion = love.graphics.newShader([[
extern number time;
extern number size;
vec4 effect(vec4 color, Image tex, vec2 tc, vec2 pc)
{
vec2 p = tc;
p.x = p.x + sin(p.y * size + time) * 0.03;
return Texel(tex, p);
}
]])
distortion:send("size", 10)
end