-
Notifications
You must be signed in to change notification settings - Fork 0
/
queasy_checkerboard.sttf
1 lines (1 loc) · 1.64 KB
/
queasy_checkerboard.sttf
1
{"links":[{"end":"RenderOutput","filter":"Linear","slot":0,"start":"Image","wrapMode":"Repeat"}],"metadata":{"Author":"jcreed","Description":"Go home, checkerboard, you are drunk.","Name":"Queasy Checkerboard","ShaderToyURL":"https://www.shadertoy.com/view/ldBXz3"},"nodes":[{"class":"RenderOutput","name":"RenderOutput"},{"class":"GLSLShader","name":"Image","source":"#define time iTime*0.5\n\nfloat grid(vec2 p) {\n vec2 orient = normalize(vec2(1.0,3.0));\n vec2 perp = vec2(orient.y, -orient.x);\n float g = mod(floor(1. * dot(p, orient)) + floor(1. * dot(p, perp)), 2.);\n return g;\n}\n\n#define samp 30.\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord )\n{\n vec2 p = fragCoord.xy / 50. + vec2(-time, time);\n vec2 q = (fragCoord.xy - (iResolution.xy / 2.)) / iResolution.x / 1.5 ;\n vec4 c = vec4(grid(p));\n if (q.x + 0.1 * q.y > 100.) {\n fragColor = c;\n }\n else {\n vec4 cc = vec4(0.0);\n float total = 0.0;\n \n float radius = length(q) * 100.;\n for (float t = -samp; t <= samp; t++) {\n float percent = t / samp;\n float weight = 1.0 - abs(percent);\n\t float u = t / 100.;\n vec2 dir = vec2(fract(sin(537.3 * (u + 0.5)) ) , fract(sin(523.7 * (u + 0.25)) ));\n dir = normalize(dir) * 0.01;\n float skew = percent * radius;\n vec4 samplev = vec4(\n grid(vec2(0.03,0.) + p + dir * skew),\n grid(radius * vec2(0.005,0.00) + p + dir * skew),\n grid(radius * vec2(0.007,0.00) + p + dir * skew),\n 1.0);\n cc += samplev * weight;\n total += weight;\n }\n\n\n fragColor = cc / total - length(q ) * vec4(1.,1.,1.,1.) * 1.5;\n }\n}\n\n","type":"Image"}]}