varying vec3 eye;
varying vec3 normal;
uniform samplerCube spcTex1;
varying float color;
uniform vec3 lightPos;
varying float glowHack;
void main()
{
vec3 normal2 = normalize(normal);
//we know that a normal going straight up is going to have to be 
//adjusted to create a more lush look.
//normal2.x+=pow(normal2.y,16.0)*sin(color)*2.1-1.0;
//normal2.z+=pow(normal2.y,16.0)*sin(color)*2.1-1.0;
normal2 = normalize(normal2);
vec3 eye2 = normalize(eye);

vec4 val = textureCube(spcTex1,reflect(normal2,eye2).xyz*10.0);
float colEff = color;


vec3 lightPos2 = normalize(lightPos);
float lightRec = max(0.2,dot(normal2,lightPos2));
vec3 reflecVec = reflect(lightPos,normal2).xyz;
float specEff = max(dot(reflecVec,eye2),0.0);
specEff = pow(specEff,12.0);
colEff+=specEff*0.002;


val.r += colEff*1.0;
val.g += colEff*1.0;
val.b += colEff*1.0;
val*=lightRec;

//val*=gl_FrontMaterial.ambient.r;
 gl_FragColor = vec4(val.r,val.g,val.b,1.0);
}