diff --git a/shaders/clouds.omwfx b/shaders/clouds.omwfx index 7f613ff..b8c3b8d 100644 --- a/shaders/clouds.omwfx +++ b/shaders/clouds.omwfx @@ -457,6 +457,19 @@ fragment main { } } + //trims away the glowing white region when looking off a high place + if (wpos.z < omw.eyePos.z + 10 && cull_dist > HORIZON * 0.001){ + mist = 0.0; + } + + //fade out the clouds near the horizon to make them blend together + if (dir.z < -0.0){ + cloud = 0.0; + } else if (dir.z < 0.2){ + float cloudFadeIn = clamp(pow((dir.z * 5.0), 3), 0, 1); + cloud *= cloudFadeIn; + } + //float attenuation = 0.00009 / (1.0 + wpos.z / 300); return vec2( @@ -669,16 +682,17 @@ fragment main { col.rgb = mix(mix(omw.sunColor.rgb, normalize(omw.sunColor.rgb), 0.75) * 0.4, col.rgb, 1.0 / (1.0 + max_dist * 0.005 * pow(interior_mist, 2))); } } else { - if (max_dist >= HORIZON * 0.9) { - if (replace_skybox) { - // Darken the sky above - col.rgb = sky_color * mix(vec3(0.5, 0.7, 0.9), vec3(1.0), vec3(1.0 - dir.z)); - } - if (better_sun) { - col.rgb += sun_light(dir); - } + if (max_dist >= HORIZON * 0.9) { + if (replace_skybox) { + // Darken the sky above + col.rgb = sky_color * mix(vec3(0.5, 0.7, 0.9), vec3(1.0), vec3(1.0 - dir.z)); + } + if (better_sun) { + col.rgb += sun_light(dir); } - col = apply_fog(col, wpos, dir, max_dist, dyn_clouds, dyn_mist); + } + + col = apply_fog(col, wpos, dir, max_dist, dyn_clouds, dyn_mist); } if (point_glow_enabled && point_glow_intensity > 0.0) {