Smoother clouds

This commit is contained in:
Joshua Barretto 2022-03-13 16:44:13 +00:00 committed by IsseW
parent 4181331e6b
commit dc90d637c1
2 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission, out float not_underground
#if (CLOUD_MODE >= CLOUD_MODE_LOW)
cloud += max(noise_3d((wind_pos) / 25000.0 / cloud_scale) - 0.75 + noise_3d((wind_pos) / 2500.0 / cloud_scale) * 0.1, 0)
* 0.1
/ (abs(pos.z - cloud_alt) / 500.0 + 0.1);
/ (abs(pos.z - cloud_alt) / 500.0 + 0.2);
#endif
// Keeping this because it's something I'm likely to reenable later
@ -303,7 +303,7 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of
surf_color = mix(
surf_color,
mix(colors[rainbow_c], colors[rainbow_c + 1], rainbow_t),
rain * sun_access * sun_access * get_sun_brightness() * pow(min(cdist / 500.0, 1.0), 2.0),
rain * sun_access * sun_access * get_sun_brightness() * pow(min(cdist / 500.0, 1.0), 2.0)
);
}
#endif

View File

@ -182,7 +182,7 @@ impl WeatherSim {
let pressure = (base_nz.get(spos.into_array()) * 0.5 + 1.0).clamped(0.0, 1.0) as f32;
cell.cloud = 1.0 - pressure;
cell.cloud = (1.0 - pressure) * 0.5;
cell.rain = (1.0 - pressure - 0.2).max(0.0).powf(1.5);
cell.wind = Vec2::new(
rain_nz.get(spos.into_array()) as f32,