Skip to content

Instantly share code, notes, and snippets.

@EmmaEwert
Created December 11, 2014 08:35
Show Gist options
  • Save EmmaEwert/167fae562a47aa33c839 to your computer and use it in GitHub Desktop.
Save EmmaEwert/167fae562a47aa33c839 to your computer and use it in GitHub Desktop.
#define #define $
$ half f
$ dot •(
$ ~ saturate(
$ _m M
f n(f2 p){f4 a=f4(floor(p+•p,.3660)),.2113,-.5774);p+=•a.xy,a.z)-a;f4 c=f4(~sign(p-p.yx)),0,1);f3 d=2*frac(_(_(a.y+c.zyw)+a.x+c.zxw)*.0244)-1;f4x3 e=f4x3(a.zzww+p.xyxy-c.xyzz,p,abs(d)-.5,d-round(d));f4x3 g=e*e;return 130*•pow(~.5-(g.M11M00M02+g.M12M01M10)),4)*rsqrt(g[2]+g[3]),e[2]*e.M12M01M10+e[3]*e.M11M00M02);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment