<Shader>
	<VertexShader>
	<Code>
		<![CDATA[
			#version 110
			attribute float IndxAttrib;

			uniform vec4 PosTC[64]; 
			uniform vec4 QuadData[64]; 
			varying vec2 Texcoord;



			void main( void )
			{
				int VertexId = int(IndxAttrib);
				int QuadId = ((VertexId)/4)*4;
				Texcoord = PosTC[VertexId].zw;


				gl_Position = vec4(PosTC[VertexId].xy, -1.0, 1.0);
			}
		]]>
		</Code>
	</VertexShader>
	
	<FragmentShader>
		<Code>
		<![CDATA[
			#version 110
			varying vec2 Texcoord;
			varying vec4 Data1;
			varying vec4 Data2;
			
			uniform sampler2D Map0;
			uniform float time;
			uniform float width;

			void main(void)
			{
				vec2 p = -1.0 + 2.0 * Texcoord;// * gl_FragCoord.xy / resolution.xy;
			    vec2 s = p;

			    vec3 total = vec3(0.0);
			    vec2 d = (vec2(0.0, 0.0)-p)/25.0;
			    vec2 q = vec2( sin(1.1*time), sin(1.2*time) );

			    float w = 1.0;
			    for( int i=0; i < 25; i++ )
			    {
			        vec3 res = texture2D(Map0, (s+q)*.5).xyz;
			        res = smoothstep(0.1, 1.0, res*res);
			        total += w*res;
			        w *= .99;
			        s += d* mix(0.2, 1.0, (smoothstep(width, width +0.1, s.x) + smoothstep(-width, -width - 0.1, s.x)));
			    }
			    total /= 25.0;
			    float r = 1.5/(1.0+dot(p,p)*2.0);
			    gl_FragColor = vec4(total*r, 1.0);
			}
		]]>
		</Code> 
	</FragmentShader>
</Shader>
