diff --git a/Effects/water-inland.eff b/Effects/water-inland.eff index e357691a0..68f61d7f8 100644 --- a/Effects/water-inland.eff +++ b/Effects/water-inland.eff @@ -826,6 +826,11 @@ int quality_level + + tquality_level + int + tquality_level + ocean_flag int diff --git a/Effects/water.eff b/Effects/water.eff index 80fb5b8c4..ecd6b4ba0 100644 --- a/Effects/water.eff +++ b/Effects/water.eff @@ -853,6 +853,11 @@ int quality_level + + tquality_level + int + tquality_level + ocean_flag int diff --git a/Shaders/water-ALS-high.frag b/Shaders/water-ALS-high.frag index ab6b78213..0a0ea5822 100644 --- a/Shaders/water-ALS-high.frag +++ b/Shaders/water-ALS-high.frag @@ -64,6 +64,7 @@ uniform float landing_light1_offset; uniform float landing_light2_offset; uniform int quality_level; +uniform int tquality_level; uniform int ocean_flag; uniform int cloud_shadow_flag; uniform int use_searchlight; @@ -552,7 +553,7 @@ void main(void) vec3 secondary_light = vec3 (0.0,0.0,0.0); - if (quality_level >5) + if ((quality_level >5)&&(tquality_level > 5)) { if (use_searchlight == 1) { @@ -566,11 +567,11 @@ void main(void) { secondary_light += landing_light(landing_light2_offset); } - - //specular.rgb+= secondary_light; + } finalColor = refl + specular * smoothstep(0.3, 0.6, ground_scattering) + vec4 (secondary_light, 0.0) * light_distance_fading(dist) * 2.0 * pow(max(0.0,dot(E,N)), water_shininess); + //add foam vec4 foam_texel = texture2D(sea_foam, vec2(waterTex2 * tscale) * 25.0); if (dist < 10000.0) @@ -605,18 +606,24 @@ void main(void) finalColor.a = 1.0; - } -//vec4 (secondary_light * light_distance_fading(dist), 0.0) * max(0.0,pow(dot(E,N)), water_shininess); + + finalColor *= vec4 (ambient_light.rgb + secondary_light * light_distance_fading(dist), ambient_light.a); // Rayleigh color shift due to out-scattering - float rayleigh_length = 0.4 * avisibility * (2.5 - 1.9 * air_pollution)/alt_factor(eye_alt, eye_alt+relPos.z); - float outscatter = 1.0-exp(-dist/rayleigh_length); - finalColor.rgb = rayleigh_out_shift(finalColor.rgb,outscatter); + float rayleigh_length; + float outscatter; + + if ((quality_level > 5) && (tquality_level > 5)) + { + rayleigh_length = 0.4 * avisibility * (2.5 - 1.9 * air_pollution)/alt_factor(eye_alt, eye_alt+relPos.z); + outscatter = 1.0-exp(-dist/rayleigh_length); + finalColor.rgb = rayleigh_out_shift(finalColor.rgb,outscatter); + } // here comes the terrain haze model @@ -768,7 +775,8 @@ if (intensity > 0.0) // this needs to be a condition, because otherwise hazeColo float lightIntensity = length(gl_Color.rgb)/1.73 * rShade; vec3 rayleighColor = vec3 (0.17, 0.52, 0.87) * lightIntensity; float rayleighStrength = rayleigh_in_func(dist, air_pollution, avisibility/max(lightIntensity,0.05), eye_alt, eye_alt + relPos.z); - finalColor.rgb = mix(finalColor.rgb, rayleighColor, rayleighStrength); + if ((quality_level > 5) && (tquality_level > 5)) + {finalColor.rgb = mix(finalColor.rgb, rayleighColor, rayleighStrength);} finalColor.rgb = mix(eqColorFactor * hazeColor * eShade +secondary_light * fog_backscatter(avisibility), finalColor.rgb,transmission); diff --git a/Shaders/water-ALS.vert b/Shaders/water-ALS.vert index 65084d392..8f8730d59 100644 --- a/Shaders/water-ALS.vert +++ b/Shaders/water-ALS.vert @@ -239,6 +239,10 @@ else // the faster, full-day version without lightfields specular_light = specular_light * scattering; + float shade_depth = 1.0 * smoothstep (0.6,0.95,ground_scattering) * (1.0-smoothstep(0.1,0.5,overcast)) * smoothstep(0.4,1.5,earthShade); + + specular_light.rgb *= (1.0 + 1.2 * shade_depth); + yprime_alt = -sqrt(2.0 * EarthRadius * hazeLayerAltitude); }