

float intime(float a, float b, float fadelen, float time){
	return smoothstep(a,a+fadelen, time)*smoothstep(b,b-fadelen, time);
}

void a_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{
	oPos = mul(worldViewProjMatrix, pos);
	oTex = tex;
}


float4 a_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float e[5];
	
	e[0] = sin(tex.x*7.3+tt*6.4)*0.11+sin(tex.x*4.0+tt*7.5)*0.12;
	e[1] = sin(tex.x*12.1+tt*9.1)*0.14+sin(tex.x*6.3+tt*5.23)*0.12;
	e[2] = sin(tex.x*5.8+tt*7.3)*0.15+sin(tex.x*7.1+tt*8.34)*0.12;
	e[3] = sin(tex.x*10.3+tt*4.2)*0.13+sin(tex.x*5.7+tt*9.34)*0.12;
	e[4] = sin(tex.x*8.5+tt*7.5)*0.12+sin(tex.x*2.3+tt*8.1)*0.12;
	
	float a[5];
	a[0] = clamp(1-pow((y*2-1)+e[0],2)*512,0,1);
	a[1] = clamp(1-pow((y*2-1)+e[1],2)*256,0,1);
	a[2] = clamp(1-pow((y*2-1)+e[2],2)*128,0,1);
	a[3] = clamp(1-pow((y*2-1)+e[3],2)*64,0,1);
	a[4] = clamp(1-pow((y*2-1)+e[4],2)*64,0,1);
	float sss = a[0]+a[1]+a[2]+a[3]+a[4];
	

	float f = sin(tex.x*10.0+tt*12.0)*0.3+sin(tex.x*4.0+tt*7.5)*0.2;
	
	float ya = clamp(1-pow((y*2-1)*2+f,2)*2,0,1);
	
	float4 t = tex2D(w,float2(
		x,ya
	));
	float4 aa = float4(0.8-y,0.5-y,0.4-y,0);
	
	return float4(sss.xxx,1.0)+pow(aa,2)+t*clamp(0,1,(1-tt/ya/10.0))*intime(53.5,63,0.4,tt) + float4(1.0,1.0,1.0,1.0)*(1-intime(0,63,0.4,tt));
}


void b_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 b_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	y += intime(0,sin(tt)*0.5+0.5,0.0001,tex.x-mod(tt*0.2,1.1)+0.1)*0.3*intime(90,123,4,tt);
	y += intime(0,cos(tt)*0.5+0.5,0.0001,tex.x-mod(tt*0.3,1.1)+0.1)*0.7*intime(90,123,4,tt);
	x += intime(0,sin(tt)*0.5+0.5,0.0001,tex.y-mod(tt*0.4,1.1)+0.1)*0.4*intime(90,123,4,tt);
	x += intime(0,cos(tt)*0.5+0.5,0.0001,tex.y-mod(tt*0.1,1.1)+0.1)*0.5*intime(90,123,4,tt);
	float4 t = tex2D(w,float2(x,y))*float4(abs(sin(tt)),abs(sin(tt+3.14159/3)),abs(sin(tt+3.14159*2/3)),1.0);
	
	float4 a = t+float4(0.2-y,0.5-y,0.4-y,0.0)+2*(1-intime(3.23,11,1.0,tt))*(1-intime(107,123.2,0.5,tt));
	
	return a * intime(-1,123,4.0,tt);
}
void bb_vp(uniform float tt, in float4 pos : POSITION, uniform in float4x4 wm, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{
	float4 pp = pos;
	float tx = intime(5,12,0.9,tt);
	pp.x += sin(tt*10+mul(wm, pp).y*0.05)*20*(2+sin(tt))*tx;
	oPos = mul(worldViewProjMatrix, pp);
	oTex = tex;
}

float4 bb_fp( 
	uniform float tt,
	varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float e = 1.0;
	
	float4 t = float4(e,e,e, 1.0);
	
	return t;
}
void cc_vp(uniform float tt, in float4 pos : POSITION, uniform in float4x4 wm, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{
	float4 pp = pos;
	
	pp.x*=(1.0 + abs(pp.z)*0.5);
	oPos = mul(worldViewProjMatrix, pp);
	oTex = tex;
}

float4 cc_fp( 
	uniform float tt,
	varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = float4(1.0, 1.0, 1.0, 1.0);
	
	return t;
}
void dd_vp(uniform float tt, in float4 pos : POSITION, uniform in float4x4 wm, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{
	float4 pp = pos;
	
	pp.x += sin(mul(wm, pp).z)*32;
	
	pp.x*=(1.0 + abs(pp.z)*0.5);
	oPos = mul(worldViewProjMatrix, pp);
	oTex = tex;
}

float4 dd_fp( 
	uniform float tt,
	varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = float4(1.0, 1.0, 1.0, 1.0);
	
	return t;
}

void c_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 c_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,float2(x,y))+float4(0.7-y,0.4-y,0.9-y,1.0)+intime(0,25.5,0.5,tt)*2;
	
	return t;
}

void d_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 d_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,float2(x,y))+float4(0.7-y,0.6-y,0.4-y,1.0)+intime(0,30,0.5,tt)*2;
	
	return t;
}


void e_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 e_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,tex)+float4(0.3-y,0.5-y,0.7-y,0)+intime(0,12,1,tt)*2;
	
	return t;
}


void f_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 f_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,tex)+float4(0.5-y,0.7-y,0.9-y,1.0);
	
	return t;
}
void g_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 g_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
		float x = tex.x;
	float y = tex.y;
	tt-=50.2;
	
	float f = sin(tex.x*10.0+tt*6.0)*0.4+sin(tex.x*4.0+tt*5.5)*0.3;
	
	float ya = clamp((-1+tt*0.5)-pow((y*2-1)+f,2)*tt,0,1);
	
	float4 t = tex2D(w,float2(
		x,ya
	));
	float4 aa = float4(0.8-y,0.5-y,0.4-y,0);
	
	return pow(aa,2)+t*clamp(0,1,(1-tt/ya/10.0))*intime(50.2,53.5,0.3,tt+50.2) + (1-intime(0,53.5,0.4,tt+50.2));
}
void h_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 h_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,tex)+float4(0.3-y,0.5-y,0.7-y,0)+(1-intime(0,25,3,tt));
	
	return t;
}
void i_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 i_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,tex)+(1-intime(63,68,1,tt));
	
	return t;
}

void j_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 j_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{

	float x = tex.x;
	x += intime(0,sin(tt)*0.5+0.5,0.0001,tex.y-mod(tt*0.2,1.1)+0.1)*0.3*intime(72,84,4,tt);
	x += intime(0,cos(tt)*0.5+0.5,0.0001,tex.y-mod(tt*0.3,1.1)+0.1)*0.7*intime(74,84,4,tt);
	float y = tex.y;
	
	
	float4 t = tex2D(w,float2(x,y))+float4(0.9-y,0.6-y,0.2-y,0) + (1-intime(68,84,1.5,tt));
	
	return t;
}
void k_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 k_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	//tt+=84;
	float x = tex.x;
	float y = tex.y;
	y += intime(0,sin(tt)*0.5+0.5,0.0001,tex.x-mod(tt*0.2,1.1)+0.1)*0.3*intime(90,103,2,tt);
	y += intime(0,cos(tt)*0.5+0.5,0.0001,tex.x-mod(tt*0.3,1.1)+0.1)*0.7*intime(90,103,2,tt);
	x += intime(0,sin(tt)*0.5+0.5,0.0001,tex.y-mod(tt*0.4,1.1)+0.1)*0.4*intime(90,103,2,tt);
	x += intime(0,cos(tt)*0.5+0.5,0.0001,tex.y-mod(tt*0.1,1.1)+0.1)*0.5*intime(90,103,2,tt);

	float e[5];
	
	e[0] = sin(x*17.3+tt*13.4)*0.11+sin(x*14.0+tt*12.5)*0.12;
	e[1] = sin(x*22.1+tt*13.1)*0.14+sin(x*16.3+tt*15.23)*0.12;
	e[2] = sin(x*15.8+tt*15.3)*0.15+sin(x*17.1+tt*11.34)*0.12;
	e[3] = sin(x*20.3+tt*14.2)*0.13+sin(x*15.7+tt*16.34)*0.12;
	e[4] = sin(x*18.5+tt*11.5)*0.12+sin(x*12.3+tt*14.1)*0.12;
	
	float a[5];
	a[0] = clamp(1-pow((y*2-1)*2+e[0],2)*512,0,1);
	a[1] = clamp(1-pow((y*2-1)*2+e[1],2)*256,0,1);
	a[2] = clamp(1-pow((y*2-1)*2+e[2],2)*128,0,1);
	a[3] = clamp(1-pow((y*2-1)*2+e[3],2)*64,0,1);
	a[4] = clamp(1-pow((y*2-1)*2+e[4],2)*64,0,1);
	
	float sss = a[0]+a[1]+a[2]+a[3]+a[4];
	
	float4 t = tex2D(w,float2(
		x,y
	));
	return t*0.5+float4(sss.xxx,1.0)+float4(pow(0.6-y,1)-intime(87.5,103, 2, tt)*0.4,0.3-y+intime(87.5,103, 2, tt)*0.6,pow(0.7-y,2)-intime(87.5,103, 2, tt)*0.6,1.0)+(1-intime(0,1,0.5,abs(sin(tt*24))))*intime(87.25,103,0.5,tt) + (1-intime(84,107,2,tt))*1.5;
}
void l_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 l_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,tex)+(1-intime(0,1,0.5,abs(sin(tt*24))));
	
	return t;
}
void m_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 m_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,tex);
	
	return t + (1-intime(107,110.2, 1, tt));
}
void n_vp(float4 pos : POSITION, in float2 tex : TEXCOORD0, out float4 oPos : POSITION, out varying float2 oTex : TEXCOORD0, uniform float4x4 worldViewProjMatrix)
{oPos = mul(worldViewProjMatrix, pos);oTex = tex;}

float4 n_fp	( uniform float tt, varying float2 tex : TEXCOORD0, uniform sampler2D w : register(s0) ) : COLOR
{
	float x = tex.x;
	float y = tex.y;
	
	float4 t = tex2D(w,tex)*intime(110.2,123,4,tt);
	
	return t+float4(0.4-y,0.3-y,0.6-y,1.0)+(1-intime(110.2,130,4,tt));
}