
    #version 120 

    #extension GL_EXT_bindable_uniform : enable 

    #extension GL_EXT_gpu_shader4 : enable 
#define tex2D texture2D



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

uniform mat4 ProjectionMatrix;

varying vec4 ShadowPosZ;
varying vec4 Color;
				uniform sampler2D texture2d_1;

void main()
{

vec4 glVertex= gl_Vertex;

float distt=length((glVertex.xz-vec2 (0.6,0.4)));
float distt2=length((glVertex.xz-vec2 (0.6,-0.4)));

if (distt2<distt) distt=distt2;

//if ((glVertex.x)>0.289) if (abs(glVertex.z)>0.5) glVertex.y+=(distt)*sin(ttime);
if ((glVertex.x)<-0.98)
{
float how=-glVertex.x-0.98;
glVertex.y+=how*0.5*sin(3.0*ttime+0.9*glVertex.z);
glVertex.z+=how*0.2*sin(2.3*ttime+glVertex.z);
}

if ((glVertex.x)>1.00)
{
float how=glVertex.x-1.0;
//glVertex.y+=how*0.5*sin(3.0*ttime+glVertex.z);
glVertex.z+=how*0.4*sin(1.3*ttime+glVertex.z);
}


if ((glVertex.z)>0.79)
{
float how=glVertex.z-0.79;
//glVertex.y+=how*0.5*sin(3.0*ttime+glVertex.z);
glVertex.y+=how*0.2*sin(1.4*ttime);
}
if ((-glVertex.z)>0.79)
{
float how=-glVertex.z-0.79;
//glVertex.y+=how*0.5*sin(3.0*ttime+glVertex.z);
glVertex.y+=how*0.2*sin(1.6*ttime);
}

//if (abs(glVertex.z)>0.5) glVertex.y+=(distt)*sin(ttime);
//sin(ttime);


position=glVertex.xyz;
glVertex= gl_TextureMatrix[0] * glVertex;
gl_Position =  glVertex;
normal=gl_Normal;
normalB=  gl_ModelViewProjectionMatrix * gl_TextureMatrix[0]*gl_Normal.xyzz;
gl_Position = gl_ModelViewProjectionMatrix * gl_Position;


	//gl_PointSize =40.0/gl_Position.w;

}











