Better water transparency

This commit is contained in:
Joshua Barretto 2019-11-18 11:08:43 +00:00
parent fd2c9e8cde
commit 9d48cc8fb7
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ void main() {
// 0 = 100% reflection, 1 = translucent water
float passthrough = pow(dot(faceforward(f_norm, f_norm, cam_to_frag), -cam_to_frag), 0.5);
vec4 color = mix(vec4(reflect_color * 2.0, 1.0), vec4(surf_color, 4.0 / (1.0 + diffuse_light * 2.0)), passthrough);
vec4 color = mix(vec4(reflect_color * 2.0, 1.0), vec4(surf_color, 4.0 / (4.0 + diffuse_light * 1.0)), passthrough);
tgt_color = mix(color, vec4(fog_color, 0.0), fog_level);
}

View File

@ -267,7 +267,7 @@ vec3 get_sky_color(vec3 dir, float time_of_day, vec3 f_pos, float quality, bool
vec4 clouds = get_cloud_color(dir, time_of_day, f_dist, 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));
if (f_dist > 1000.0) {
if (f_dist > 5000.0) {
sky_color += sun_light + moon_light;
}