
    #version 120 

    #extension GL_EXT_bindable_uniform : enable 

    #extension GL_EXT_gpu_shader4 : enable 
#define tex2D texture2D



varying vec3 normal;
varying vec3 normalB;
varying vec2 texture_coordinate_1; 
//varying vec3 vertex_to_light_vector;
varying vec4 position;
				uniform float PosY;
				uniform float ttime;
varying vec4 projection_position;

uniform mat4 ProjectionMatrix;

varying vec4 ShadowPosZ;
varying vec4 Color;
				uniform sampler2D texture2d_1;
				uniform sampler2D texture2d_2;
				uniform sampler1D textureDSP;
uniform float particlesize;
uniform float magnifier;
uniform float realttime;
varying float rnd;

varying vec2 TheUV;

void main()
{
rnd=1.0;
vec4 glVertex= gl_Vertex;
vec4 glVertexTemp=gl_Vertex;

float Displacement;


Displacement=0.0+texture2D (texture2d_1,glVertex.xy+vec2 (realttime*0.01,0.0)).x*0.5;
Displacement*=pow(texture2D (texture2d_1,glVertex.xy*0.02+vec2 (realttime*0.004,0.0)).x,6.0)*6.4;
Displacement+=0.08*sin(length (glVertex.xy*14.0)+realttime*2.0);
//*10.2*pow(clamp (1.001*sin(4.0*0.01+4.7*0.2+(1.0/2.5)*ttime*2.0*3.1416),0.0,1.0),18.0);


Displacement=texture2D (texture2d_2,glVertex.xy*1.0).x*10.0;


Color=vec4 (0.0+texture2D (texture2d_1,glVertex.xy*0.3+vec2 (ttime*0.0,0.0)).y);

float Cll=texture2D (texture2d_1,glVertex.xy*1.7+vec2 (realttime*0.008,0.0)).x;
Cll=pow(1.8*Cll,6.0)*1.3+1.3;







{	
	vec4 glVertex2=glVertexTemp;

	float glVertexTemp_y=texture2D (texture2d_1,vec2(glVertexTemp.y*0.6,glVertexTemp.x)+vec2 (ttime*0.000)).x*4.0-0.5;
	 glVertexTemp_y+=texture2D (texture2d_1,vec2(glVertexTemp.xy*1.6)+vec2 (ttime*0.000)).x*0.5;
	float glVertexTemp_x=texture2D (texture2d_1,vec2(glVertexTemp.y*0.3,glVertexTemp.x*0.6)+vec2 (ttime*0.000)).x*5.0;
glVertexTemp_x+=texture2D (texture2d_1,vec2(glVertexTemp.yx*3.3)+vec2 (ttime*0.000)).x*0.5;
	float dist=sin(glVertexTemp_y*3.141593)*1.0+
0.0*pow (1.1*texture2D (texture2d_1,vec2(glVertexTemp.y*0.6,glVertexTemp_x)+vec2 (ttime*0.001)).x,3.0)*2.5;
//dist=1.0;
glVertex2.x=sin(ttime*0.0+glVertexTemp_x*2.0*3.141593)*1.0*dist;
glVertex2.y=cos(ttime*0.0+glVertexTemp_x*2.0*3.141593)*1.0*dist;
glVertex2.z=(glVertexTemp_y-0.5)*2.0;
glVertex2.xyz/=length (glVertex2.xyz);
glVertex2.xyz*=130.0;


glVertex=glVertex2;
}


if (ttime<41.0) glVertex.z+=4.3*10.0;
else
if (ttime<84.0) glVertex.z+=(-2.6*20.0)+(3.6*20.0*clamp ((ttime-47.0)*0.08,0.0,1.0));;
if (ttime>103.5) {
	
	glVertex.z+=-5.0*12.0;
	glVertex.z+=5.0*12.0*clamp ((ttime-107.0)*0.16,0.0,1.0);
	glVertex.z-=6.0*12.0*clamp ((ttime-120.0)*0.2,0.0,1.0);

}
if ((ttime>132.0) && (ttime<141.5))glVertex.z+=100.0;
if (ttime>141.5) glVertex.z+=3.7*10.0;
if (ttime>194.5) glVertex.z+=2000.0;
if (ttime>203.9) glVertex.z-=2000.0-3.8*10.0;
if (ttime<21.0) glVertex.z+=1000.0;

//glVertex.z+=PosY*100.0;
glVertex= gl_TextureMatrix[0] * glVertex;

gl_Position =  glVertex;

TheUV=gl_MultiTexCoord0.st;
//vec2 TheUV1=gl_Vertex.xy*0.03;
//TheUV1=gl_MultiTexCoord0.st*3.0;
//Color=vec4 (1.0);
gl_Position = gl_ModelViewProjectionMatrix * gl_Position;
//rnd=gl_Color.r;
position=gl_Position;
Cll*=8.0;
//*Cll;
Color*=5.0;
rnd=1000000.0;
//float ff=Color.x;Color.x=Color.z;Color.z=ff;
//swap (Color.x,Color.z);
//Cll=2.0;
//	gl_PointSize =1-7.0/gl_Position.w;
	gl_PointSize =Cll*particlesize*125.0/gl_Position.w;
	//gl_PointSize =particlesize*125.0/gl_Position.w;
	///gl_Position.w;

}











