varying vec3 eye_look_dir;
void main()
{
- vec4 eye_pos = vec4(mat3(gl_ModelViewMatrix)*gl_Vertex.xyz, 1);
+ vec4 eye_pos = vec4((gl_ModelViewMatrix*vec4(gl_Vertex.xyz, 0.0)).xyz, 1.0);
gl_Position = gl_ProjectionMatrix*eye_pos;
eye_look_dir = eye_pos.xyz;
}";
if(c<0.0031308)
return 12.92*c;
else
- return (1.055)*pow(c, 1.0/2.4)-0.055;
+ return 1.055*pow(c, 1.0/2.4)-0.055;
}
void main()
{
vec3 n_eye_look_dir = normalize(eye_look_dir);
vec3 n_eye_sun_dir = normalize(gl_LightSource[0].position.xyz);
- if(dot(n_eye_look_dir, eye_sky_dir)>0)
+ if(dot(n_eye_look_dir, eye_sky_dir)>0.0)
{
float look_scale = thickness(dot(n_eye_look_dir, eye_sky_dir), 635.0);
float sun_scale = thickness(dot(n_eye_sun_dir, eye_sky_dir), 635.0);