So i have this shader
Code: Select all
extern vec2 screen;
extern Image map;
extern number t;
vec4 effect(vec4 color, Image tex, vec2 tc, vec2 sc)
{
vec4 m = Texel(map, tc);
if (m.r == 1)
{
tc.x = tc.x + (sin((tc.y * 0.08) * screen.x + (t * 5)) * 0.002);
tc.y = tc.y + (sin((tc.x * 0.08) * screen.y + (t * 5)) * 0.002);
return Texel(tex, tc) * color;
} else {
return Texel(tex, tc) * color;
}
}
]]
I'm not great at explaining things, There's a .love attached. The problem becomes very apparent if you jump (w) and look at the water (blue stuff above the player)
All the relative code is in src/state/game.lua