
// Uniform variables for texturing
uniform sampler2D 	aaa_tex2d[4];

// Dimension of textures : 0, 1, 2, 3 dimension, -1 if unused per Tex Unit
uniform	int			aaa_tex_dim[4];

// Size of Texture for each texture unit
uniform vec2		aaa_tex_0_size;

// 0 = time
// 1 = mouse X
// 2 = mouse Y
uniform float		aaa_pu_float[6];

void main() 
{
	vec3 p = gl_FragCoord.xyz/aaa_tex_0_size-.5;
	vec4 tex = texture2D(aaa_tex2d[0],.5+(p.xy*=.98));
	vec3 o = tex.rbb;
	
	
	
	for (float i=0.;i<50.0;i++) 
	{
		tex = texture2D(aaa_tex2d[0], 0.5+(p.xy*=0.98));
		
		p.z+=pow(max(0.0, 0.5-length(tex.rg)),2.0)*exp(-i*0.1);
	}
	
	gl_FragColor=vec4(o*o+p.z,1.0);
}