uniform float time;
uniform float amplitude;
uniform float frequency;

// Normales y tangentes
attribute vec3 rm_Binormal;
attribute vec3 rm_Tangent;


varying vec4 color;

varying vec3 vertex_light_position;
varying vec3 vertex_normal;

void main( void )
{
	// Basic per pixel illumination
	vertex_normal = normalize(gl_NormalMatrix * gl_Normal);
    	vertex_light_position = normalize(gl_LightSource[0].position.xyz);
	// End ppi

	//vec3 fvBinormal       = gl_NormalMatrix * rm_Binormal;
	//vec3 fvTangent        = gl_NormalMatrix * rm_Tangent;


	float r = length(gl_Vertex.xyz); // Got distance from origin
	float amp = 0.2*sin(time*0.5*gl_Vertex.y) + 0.2*sin(time*3.0*gl_Vertex.y);
	
	vec3 normT = normalize(gl_Normal);
	
	vec4 displace;
	displace.x = normT.x * amp;
	displace.y = normT.y * amp;
	displace.z = normT.z * amp;
	displace.w = 0.0;

	color = vec4(0.75,0.6,0.8,1);
	gl_Position = gl_ModelViewProjectionMatrix * (gl_Vertex + displace);
}