Actually, after studying pre-dawn conditions on a clear day today, it'd be worth thinking about generalizing this to even more situations.
It appears that pre-dawn light is blue rather than red. This makes a lot of sense, since red is direct light out of which the blue has been scattered away, but pre-dawn light it by necessity indirect - it's light which scatters from the high atmosphere which is already illuminated by the sun.
At the moment of dawn, all the shadow regions are still rather bluish, but as the first sunrays hit the clouds and the highest terrain points, things start to get a rosy hue (we can't get this without terrain self-shading of course). Only if there is direct light illuminating a cloud layer from below, and the light reflected from that cloud layer illuminates the ground is the pre-dawn light illuminating the ground actually red.
I've tried to color-rotate the predawn indirect ground illumination in the shader to blue, and the result looks much better, especially looking away from the sun, than keeping it intensity-reduced red. Again, this is something which is best done with the basic light rather than in every shader.
The relevant code for the terrain shader is:
- Code: Select all
// change haze color to blue hue for strong fogging
float intensity = length(hazeColor);
hazeColor = intensity * normalize(mix(hazeColor, 1.5* vec3 (0.45, 0.6, 1.0), (1.0 - eqColorFactor)));
hazeColor = intensity * normalize(mix(hazeColor, 1.5* vec3 (0.45, 0.6, 1.0), max(2.0 * (0.5 - earthShade),0.0)));
// also indirect predawn light is blue
intensity = length(fragColor.xyz);
fragColor.xyz = intensity * normalize(mix(fragColor.xyz, 1.5* vec3 (0.45, 0.6, 1.0), max(2.0 * (0.5 - earthShade),0.0)));
Here, eqColorFactor[0,1] is scattering plus the fog attenuation and earthShade [0,1] is the mean light attenuation across the terminator, where 0.5 is at sunrise (i.e. when direct light becomes available).