
    #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;
varying vec4 projection_position;

uniform mat4 ProjectionMatrix;

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

varying vec4 positionProj;

void main()
{

float time=ttime*0.5;

vec4 glVertex= gl_Vertex;
float fflo=clamp (glVertex.z-0.5,0.0,10.0);
fflo*=fflo;
glVertex.x+=fflo*0.2*sin(gl_Vertex.z*0.0+time*4.5);


float fflop=clamp (abs(glVertex.x)-0.1,0.0,10.0);
fflop*=fflop;
glVertex.z+=fflop*0.6*sin(time*4.5);
glVertex.y+=fflop*0.6*sin(time*3.5+glVertex.x);


float fflopf=clamp ((glVertex.y)-0.2,0.0,10.0);
fflopf*=fflopf;
if (glVertex.z<0.4)
glVertex.x+=fflopf*0.5*sin(glVertex.x*5.0+time*6.5);


//mouth
if (glVertex.y>0.02)
if (glVertex.z<-0.76)
{
float fflo2=clamp (-glVertex.z-0.76,0.0,10.0);
fflo2*=fflo2;
fflo2=clamp (fflo2,0.0,0.02);
glVertex.y+=fflo2*1.5*sin(time*4.0);
//glVertex.z-=0.1*sin(fflo2*PosY*10.0*sin(ttime*4));
}


float fs=clamp ((glVertex.z+1.0)*0.5,0.0,1.0);
fs=sin (fs*3.14159);
fs*=fs;
glVertex.x*=1.0+0.15*fs*sin(ttime*3.0);


//glVertex=gl_Vertex;

position=gl_Vertex.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;
positionProj=gl_Position;
// color pass
Color=gl_Color;
	//gl_PointSize =40.0/gl_Position.w;

}











