precision highp float;
#define iChannel0 inputImageTexture
#define texture(a,b) texture2D(a,fract(b))
#define fragColor gl_FragColor
varying highp vec2 textureCoordinate;

uniform sampler2D inputImageTexture;

uniform highp float iTime;

void main()
{
    highp vec2 uv = textureCoordinate;

    fragColor = texture(iChannel0, uv);

    float levels = (1.0 - abs(mod(iTime, 2.0) - 1.0)) * 9.0 + 1.0;

    fragColor.rgb = floor((fragColor.rgb * levels) + vec3(0.5)) / levels;
}