#define iChannel0 inputImageTexture
#define texture(a,b) texture2D(a,fract(b))
#define fragColor gl_FragColor
precision highp float;
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform highp float count;
uniform highp float linesAmount;
uniform highp float noiseAmount;
uniform highp float iTime;
uniform highp vec2 iResolution;

const float PI = 3.14159265359;

float rand( const in vec2 uv ) {
    float a = 12.9898;
    float b = 78.233;
    float c = 43758.5453;
    float dt = dot( uv.xy, vec2( a,b ) );
    float sn = mod( dt, PI );
    return fract(sin(sn) * c);
}

void main(){
    float height = iResolution.y;
    float time = iTime * 0.25;
    highp vec2 uv = textureCoordinate;
    highp vec4 cTextureScreen = texture2D(iChannel0, uv );
    float dx = rand( uv + time );
    highp vec3 cResult = cTextureScreen.rgb * dx * noiseAmount;
    float lineAmount = height * 1.8 * count;
    highp vec2 sc = vec2( sin( uv.y * lineAmount), cos( uv.y * lineAmount) );
    cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * linesAmount;
    cResult = cTextureScreen.rgb + ( cResult );
    gl_FragColor =  vec4( cResult, cTextureScreen.a );
}