2022-01-21 13:35:40 +00:00
|
|
|
#include <lod.glsl>
|
2022-09-24 11:33:26 +00:00
|
|
|
#include <sky.glsl>
|
2022-01-21 13:35:40 +00:00
|
|
|
|
2023-09-28 10:08:51 +00:00
|
|
|
vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, float max_dist, float quality) {
|
2022-01-21 13:35:40 +00:00
|
|
|
// Underwater light attenuation
|
|
|
|
surf_color = water_diffuse(surf_color, dir, max_dist);
|
|
|
|
|
2022-09-24 11:33:26 +00:00
|
|
|
if (max_dist < DIST_CAP) {
|
2023-09-28 10:08:51 +00:00
|
|
|
vec3 sky_light = get_sky_light(dir, false);
|
2022-09-24 11:33:26 +00:00
|
|
|
surf_color = mix(sky_light, surf_color, 1.0 / exp(max_dist / 5000.0));
|
|
|
|
}
|
|
|
|
|
2020-10-21 21:05:25 +00:00
|
|
|
return surf_color;
|
2020-01-19 03:58:25 +00:00
|
|
|
}
|