Fixed hill colour blending

This commit is contained in:
Joshua Barretto 2019-11-18 10:36:48 +00:00
parent 337383feaa
commit 0f37bfa829
2 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
uniform sampler2D src_color;
const float FXAA_SCALE = 1.5;
const float FXAA_SCALE = 1.25;
/**
Basic FXAA implementation based on the code on geeks3d.com with the
@ -134,4 +134,4 @@ vec4 aa_apply(sampler2D tex, vec2 fragCoord, vec2 resolution) {
//compute FXAA
return fxaa(tex, scaled_fc, scaled_res, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
}
}

View File

@ -160,7 +160,7 @@ vec4 get_cloud_color(vec3 dir, float time_of_day, float max_dist, float quality)
float incr = min(INCR + start / 100000.0, INCR * 2.0) / quality;
float fuzz = texture(t_noise, dir.xy * 100000.0).x * 1.75 * incr * delta;
float fuzz = texture(t_noise, dir.xz * 100000.0).x * 2.0 * incr * delta;
if (delta <= 0.0) {
return vec4(0);
@ -188,7 +188,7 @@ vec4 get_cloud_color(vec3 dir, float time_of_day, float max_dist, float quality)
}
}
return vec4(vec3(cloud_shade), 1.0 - passthrough / (1.0 + delta * 0.0003));
return vec4(vec3(cloud_shade), 1.0 - passthrough / (1.0 + min(delta, max_dist) * 0.0003));
}
vec3 get_sky_color(vec3 dir, float time_of_day, vec3 f_pos, float quality, bool with_stars) {
@ -267,8 +267,8 @@ vec3 get_sky_color(vec3 dir, float time_of_day, vec3 f_pos, float quality, bool
vec3 moon_light = clamp(moon_halo + moon_surf, vec3(0), vec3(clamp(dir.z * 3.0, 0, 1)));
// Clouds
vec4 clouds = get_cloud_color(dir, time_of_day, distance(cam_pos.xyz, f_pos), quality);
clouds.rgb *= get_sun_brightness(sun_dir) * (sun_halo * 2.5 + get_sun_color(sun_dir)) + get_moon_brightness(moon_dir) * (moon_halo * 2.5 + get_moon_color(moon_dir));
vec4 clouds = get_cloud_color(dir, time_of_day, vsum(abs(cam_pos.xyz - f_pos)), quality);
clouds.rgb *= get_sun_brightness(sun_dir) * (sun_halo * 2.5 + get_sun_color(sun_dir)) + get_moon_brightness(moon_dir) * (moon_halo * 20.5 + get_moon_color(moon_dir));
return mix(sky_color + sun_light + moon_light, clouds.rgb, clouds.a);
}