diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 8fc2b64929..81649bc648 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -115,11 +115,11 @@ float is_star_at(vec3 dir) { } const float CLOUD_AVG_HEIGHT = 1025.0; -const float CLOUD_HEIGHT_MIN = CLOUD_AVG_HEIGHT - 35.0; -const float CLOUD_HEIGHT_MAX = CLOUD_AVG_HEIGHT + 35.0; +const float CLOUD_HEIGHT_MIN = CLOUD_AVG_HEIGHT - 50.0; +const float CLOUD_HEIGHT_MAX = CLOUD_AVG_HEIGHT + 50.0; const float CLOUD_THRESHOLD = 0.3; -const float CLOUD_SCALE = 1.0; -const float CLOUD_DENSITY = 100.0; +const float CLOUD_SCALE = 5.0; +const float CLOUD_DENSITY = 50.0; float vsum(vec3 v) { return v.x + v.y + v.z; @@ -127,27 +127,28 @@ float vsum(vec3 v) { vec2 cloud_at(vec3 pos) { float tick_offs = 0.0 - + texture(t_noise, pos.xy * 0.0001 + tick.x * 0.001).x * 1.0 - + texture(t_noise, pos.xy * 0.000003).x * 5.0; + + texture(t_noise, pos.xy * 0.0001 - tick.x * 0.001).x * 0.5 + + texture(t_noise, pos.xy * 0.000003).x * 3.0; float value = ( 0.0 + texture(t_noise, pos.xy / CLOUD_SCALE * 0.0003 + tick_offs).x + texture(t_noise, pos.xy / CLOUD_SCALE * 0.0009 - tick_offs).x * 0.5 + texture(t_noise, pos.xy / CLOUD_SCALE * 0.0025 - tick.x * 0.01).x * 0.25 - + texture(t_noise, pos.xy / CLOUD_SCALE * 0.008 + tick.x * 0.02).x * 0.1 + + texture(t_noise, pos.xy / CLOUD_SCALE * 0.008 + tick.x * 0.02).x * 0.15 + + texture(t_noise, pos.xy / CLOUD_SCALE * 0.02 + tick_offs + tick.x * 0.02).x * 0.1 ) / 3.0; - float density = max((value - CLOUD_THRESHOLD) - abs(pos.z - CLOUD_AVG_HEIGHT) / 500.0, 0.0) * CLOUD_DENSITY; + float density = max((value - CLOUD_THRESHOLD) - abs(pos.z - CLOUD_AVG_HEIGHT) / 400.0, 0.0) * CLOUD_DENSITY; - float shade = ((pos.z - CLOUD_AVG_HEIGHT) / (CLOUD_AVG_HEIGHT - CLOUD_HEIGHT_MIN) + 0.5); + float shade = ((pos.z - CLOUD_AVG_HEIGHT) * 1.8 / (CLOUD_AVG_HEIGHT - CLOUD_HEIGHT_MIN) + 0.5); return vec2(shade, density / (1.0 + vsum(abs(pos - cam_pos.xyz)) / 5000)); } vec4 get_cloud_color(vec3 dir, vec3 origin, float time_of_day, float max_dist, float quality) { - const float INCR = 0.06; + const float INCR = 0.1; float mind = (CLOUD_HEIGHT_MIN - origin.z) / dir.z; float maxd = (CLOUD_HEIGHT_MAX - origin.z) / dir.z; @@ -162,14 +163,14 @@ vec4 get_cloud_color(vec3 dir, vec3 origin, float time_of_day, float max_dist, f float incr = INCR; - float fuzz = sin(texture(t_noise, dir.xz * 100000.0).x * 100.0) * incr * delta; + float fuzz = sin(texture(t_noise, dir.xz * 100000.0 + tick.x).x * 100.0) * incr * delta; float cloud_shade = 1.0; float passthrough = 1.0; if (do_cast) { for (float d = 0.0; d < 1.0; d += incr) { float dist = start + d * delta; - dist += fuzz * min(pow(dist * 0.005, 2.0), 1.0); + dist += fuzz * pow(maxd - mind, 0.5) * 0.01 * min(pow(dist * 0.005, 2.0), 1.0); vec3 pos = origin + dir * min(dist, max_dist); vec2 sample = cloud_at(pos);