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

uniform float NormalContribution;
uniform vec3 ColorContribution;

uniform vec3 WaveDirection;
uniform vec3 WaveTangent;

varying vec3 color;

void main( void )
   {
   float a = sin(time*frequency+dot(WaveTangent, gl_Vertex.xyz)*MeshContribution)*amplitude;
   vec4 wave = vec4(WaveDirection*a, 0.0);
  
   gl_Position = gl_ModelViewProjectionMatrix * (gl_Vertex + wave);

   color =
     (gl_Normal.xyz + 1.0 ) / 2.0 * NormalContribution
   +
     ColorContribution;
   }