graphics changes
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / light_clearskies.glsl
index 0af3be0774ff0899ff6de75e026a85180c49b815..5cc438315f06da6887d1ec52f4bb17743d783470 100644 (file)
@@ -51,7 +51,7 @@ float stars( vec3 rd, float rr, float size ){
 
 float luminance( vec3 v )
 {
-   return dot( v, vec3(0.2126, 0.7152, 0.0722) );
+   return dot( v, vec3(0.2126, 0.7052, 0.0722) );
 }
 
 vec3 clearskies_ambient( vec3 dir )
@@ -65,7 +65,7 @@ vec3 clearskies_ambient( vec3 dir )
         ambient += g_nightsky_colour.rgb * (1.0-g_day_phase);
    
    /* Add gradient */
-        ambient -= sky_gradient * luminance(ambient);
+        ambient -= sky_gradient * luminance(ambient)*1.6;
         
    return ambient;
 }
@@ -95,7 +95,7 @@ vec3 clearskies_sky( vec3 ray_dir )
       }
    }
    
-   vec3 composite   = sky_colour + sun_colour + star*star_blend;
+   vec3 composite = sky_colour + sun_colour + star*star_blend;
    return composite;
 }
 
@@ -107,8 +107,9 @@ vec3 clearskies_lighting( vec3 normal, float shadow, vec3 halfview )
                                g_sunset_phase );
 
    vec3  sky_reflection = 0.5 * fresnel * reflect_colour;
-   vec3  light_sun      = max(0.0,dot(normal,g_sun_dir.xyz)*0.75+0.25) 
-                           * g_sun_colour.rgb * g_day_phase;
+   vec3  light_sun      = max( CLEARSKIES_LIGHT_DOT_MIN, 
+                               dot(normal,g_sun_dir.xyz)*0.75+0.25
+                           ) * g_sun_colour.rgb * g_day_phase;
 
    float scaled_shadow = max( shadow, 1.0 - max(g_sun_dir.y,0.0) );
    vec3 ambient = mix( g_ambient_colour.rgb, g_sunset_ambient.rgb,