Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from steveroll over @ discord
extern number minRadius = 0.05;
extern number maxRadius = 0.1;
extern number mul = 0.01;
extern vec2 center = vec2(0.5,0.5);
number dist(vec2 a, vec2 b){
return sqrt(pow(b.x-a.x,2)+pow(b.y-a.y,2));
}
vec4 effect(vec4 color, Image tex, vec2 tc, vec2 sc){
number d = dist(tc,center);
if(d >= minRadius && d <= maxRadius){
number td = 1-abs((d-minRadius)/(maxRadius-minRadius)-0.5)*2;
tc.y += td*mul;
}
return Texel(tex, tc) * color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment