xxxxxxxxxx
37
precision mediump float;
in vec2 pos;
// uniforms from p5.filterShader
uniform sampler2D filter_background;
uniform vec2 filter_res;
out vec4 colour;
void main() {
// ivec2 texel = ivec2(int(gl_FragCoord.x), int(gl_FragCoord.y));
// vec3 col = texelFetch(filter_background, texel, 0).rgb;
// vec3 nbs = vec3(0., 0., 0.);
// for(int i = -1; i < 2; i++) {
// for(int j = -1; j < 2; j++) {
// nbs += texelFetch(filter_background, texel + ivec2(i, j), 0).rgb;
// }
// }
// nbs -= col;
// vec3 alive = step(0.5, col);
// vec3 two_n = step(2., nbs);
// vec3 three_n = step(3., nbs);
// vec3 four_n = step(4., nbs);
// col = (1. - four_n) * (three_n + (alive * two_n));
colour = vec4(pos, 1., 1.);
}