| #extension GL_OES_standard_derivatives : enable |
| vec3 white = vec3(1, 1, 1); |
| vec3 amaranth_pink = vec3(0.945, 0.612, 0.733); |
| vec3 maya_blue = vec3(0.298, 0.624, 0.886); |
| vec3 color_for_position (vec2 position) { |
| if (sin(position.x + time / 30.0) / 2.0 - position.y + 0.4 < 0.0) { |
| } else if (sin(position.x / 5.0 + time / 21.0 + 20.0) / 2.0 - position.y + 0.5 < 0.0) { |
| vec2 position = ( gl_FragCoord.xy / resolution.xy ); |
| for (float x = 0.0; x < sampleSqrt; x++) { |
| for (float y = 0.0; y <= sampleSqrt; y++) { |
| vec3 color = color_for_position( |
| (x / (resolution.x * sampleSqrt)) + position.x, |
| (y / (resolution.y * sampleSqrt)) + position.y |
| r /= sampleSqrt * sampleSqrt; |
| g /= sampleSqrt * sampleSqrt; |
| b /= sampleSqrt * sampleSqrt; |
| gl_FragColor = vec4(vec3(r, g, b), 1.0); |