SL-10303, SL-10414

Fix positioning of sun/moon discs w.r.t atmo haze glow.

Disable killing glow when sun is not up.
master
Graham Linden 2019-01-25 16:29:05 -08:00
parent 64ce16aa07
commit 431a26c118
8 changed files with 19 additions and 16 deletions

View File

@ -132,7 +132,7 @@ void main()
temp2.x = pow(temp2.x, glow.z);
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
temp2.x *= sun_up_factor;
//temp2.x *= sun_up_factor;
// Add "minimum anti-solar illumination"
temp2.x += .25;

View File

@ -37,10 +37,11 @@ void calcAtmospherics(vec3 eye_pos);
void main()
{
//transform vertex
vec4 vert = vec4(position.xyz, 1.0);
vec3 offset = vec3(0, 0, 50);
vec4 vert = vec4(position.xyz - offset, 1.0);
vec4 pos = (modelview_matrix * vert);
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
gl_Position = modelview_projection_matrix*vert;
calcAtmospherics(pos.xyz);

View File

@ -36,13 +36,14 @@ VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
vec4 vert = vec4(position.xyz, 1.0);
vec4 pos = (modelview_matrix * vert);
//transform vertex
vec3 offset = vec3(0, 0, 50);
vec4 vert = vec4(position.xyz - offset, 1.0);
vec4 pos = (modelview_matrix * vert);
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
calcAtmospherics(pos.xyz);
gl_Position = modelview_projection_matrix*vert;
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
calcAtmospherics(pos.xyz);
}

View File

@ -38,7 +38,8 @@ void calcAtmospherics(vec3 eye_pos);
void main()
{
//transform vertex
vec4 vert = vec4(position.xyz, 1.0);
vec3 offset = vec3(0, 0, 50);
vec4 vert = vec4(position.xyz - offset, 1.0);
vec4 pos = modelview_projection_matrix*vert;
sun_fade = smoothstep(0.3, 1.0, (position.z + 50) / 512.0f);

View File

@ -153,7 +153,7 @@ void main()
// Add "minimum anti-solar illumination"
temp2.x += .25;
temp2.x *= sun_up_factor;
//temp2.x *= sun_up_factor;
// Haze color above cloud
vec4 color = ( blue_horizon * blue_weight * (sunlight + ambient)

View File

@ -119,7 +119,7 @@ void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit,
//add "minimum anti-solar illumination"
temp2.x += .25;
temp2.x *= sun_up_factor;
//temp2.x *= sun_up_factor;
//increase ambient when there are more clouds
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;

View File

@ -131,7 +131,7 @@ void main()
temp2.x = pow(temp2.x, glow.z);
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
temp2.x *= sun_up_factor;
//temp2.x *= sun_up_factor;
// Add "minimum anti-solar illumination"
temp2.x += .25;

View File

@ -119,7 +119,7 @@ void main()
temp2.x = pow(temp2.x, glow.z);
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
temp2.x *= sun_up_factor;
//temp2.x *= sun_up_factor;
// Add "minimum anti-solar illumination"
temp2.x += .25;