Better water, shadows, clouds

This commit is contained in:
Joshua Barretto 2020-11-17 03:00:05 +00:00
parent be1fb5b5d2
commit ef03137c65
3 changed files with 7 additions and 7 deletions

View File

@ -289,7 +289,7 @@ void main() {
// diffuse_light += point_light;
// reflected_light += point_light;
// vec3 surf_color = srgb_to_linear(vec3(0.2, 0.5, 1.0)) * light * diffuse_light * ambient_light;
vec3 surf_color = illuminate(max_light, view_dir, water_color * emitted_light/* * log(1.0 - MU_WATER)*/, /*cam_attenuation * *//*water_color * */reflect_color * reflected_light/* * log(1.0 - MU_WATER)*/);
vec3 surf_color = illuminate(max_light, view_dir, water_color * emitted_light/* * log(1.0 - MU_WATER)*/, /*cam_attenuation * *//*water_color * */reflect_color /** reflected_light*//* * log(1.0 - MU_WATER)*/);
// passthrough = pow(passthrough, 1.0 / (1.0 + water_depth_to_camera));
/* surf_color = cam_attenuation.g < 0.5 ?

View File

@ -53,7 +53,7 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) {
#endif
mist *= (1.0 + turb_noise);
cloud_factor = 0.25 * (1.0 - pow(min(abs(pos.z - cloud_attr.x) / (cloud_attr.y * pow(max(cloud_tendency * 20.0, 0), 0.5)), 1.0), 2.0));
cloud_factor = 0.5 * (1.0 - pow(min(abs(pos.z - cloud_attr.x) / (cloud_attr.y * pow(max(cloud_tendency * 20.0, 0), 0.5)), 1.0), 1.0));
float cloud_flat = min(cloud_tendency, 0.07) * 0.05;
cloud_flat *= (1.0 + turb_noise * 7.0 * max(0, 1.0 - cloud_factor * 5));
cloud = cloud_flat * pow(cloud_factor, 2) * 20 / (1 + pow(1.0 + dist / 10000.0, 2.0));
@ -71,10 +71,10 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) {
vec3 cloud_norm = vec3(
(cloud_tendency - cloud_tendency_x) * 6,
(cloud_tendency - cloud_tendency_y) * 6,
(pos.z - cloud_attr.x) / 250 + turb_noise
);
sun_access = mix(clamp(dot(-sun_dir.xyz, cloud_norm), 0.025, 1), sun_access, 0.25);
moon_access = mix(clamp(dot(-moon_dir.xyz, cloud_norm), 0.025, 1), moon_access, 0.25);
(pos.z - cloud_attr.x) / 450 + turb_noise
) * 0.5;
sun_access = mix(max(dot(-sun_dir.xyz, cloud_norm), 0.025), sun_access, 0.25);
moon_access = mix(max(dot(-moon_dir.xyz, cloud_norm), 0.025), moon_access, 0.25);
#endif
// Prevent mist (i.e: vapour beneath clouds) being accessible to the sun to avoid visual problems

View File

@ -91,7 +91,7 @@ float cloud_shadow(vec3 pos, vec3 light_dir) {
cloud = cloud * 2.0;
return clamp(1 - fade * cloud * 3.0, 0, 1);
return clamp(1 - fade * cloud * 1.65, 0, 1);
#endif
}