vec4 AA() { float twoThirds = 0.6667; float threeQuarters = 0.75; vec4 xc = texture(tex, tex_coord); vec4 u1 = texture(tex, tex_coord + vec2(0.0, -oneTexel.y)); vec4 u2 = texture(tex, tex_coord + vec2(0.0, -oneTexel.y * 2.0)); vec4 d1 = texture(tex, tex_coord + vec2(0.0, oneTexel.y)); vec4 d2 = texture(tex, tex_coord + vec2(0.0, oneTexel.y * 2.0)); vec4 l1 = texture(tex, tex_coord + vec2(-oneTexel.x, 0.0)); vec4 l2 = texture(tex, tex_coord + vec2(-oneTexel.x * 2.0, 0.0)); vec4 r1 = texture(tex, tex_coord + vec2(oneTexel.x, 0.0)); vec4 r2 = texture(tex, tex_coord + vec2(oneTexel.x * 2.0, 0.0)); vec4 v1 = mix(xc, mix(l1, l2, twoThirds), threeQuarters); vec4 v2 = mix(xc, mix(r1, r2, twoThirds), threeQuarters); vec4 v3 = mix(xc, mix(u1, u2, twoThirds), threeQuarters); vec4 v4 = mix(xc, mix(d1, d2, twoThirds), threeQuarters); vec4 v5 = mix(v1, v2, 0.5); vec4 v6 = mix(v3, v4, 0.5); return mix(v5, v6, 0.5); }
0 Comments
Leave a Reply. |
AuthorHi there, the name's Matthew Jenkinson and I'm currently working at Firesprite. In my spare time I work on programming projects like you see here. Archives
March 2021
CategoriesLinks to each effect in order:
|