Created
March 8, 2019 14:45
-
-
Save flamendless/4fa8d8dad6338ce2f000f0bf30734a24 to your computer and use it in GitHub Desktop.
from steveroll over @ discord
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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