Skip to content
Snippets Groups Projects
Commit 431a26c1 authored by Graham Linden's avatar Graham Linden
Browse files

SL-10303, SL-10414

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

Disable killing glow when sun is not up.
parent 64ce16aa
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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);
......
......@@ -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);
}
......@@ -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);
......
......@@ -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)
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment