Cloud movement is more prominent

This commit is contained in:
Joshua Barretto 2022-03-13 20:40:33 +00:00 committed by IsseW
parent dc90d637c1
commit 502145a6f9
4 changed files with 11 additions and 8 deletions

View File

@ -112,7 +112,7 @@ void main() {
vec2 view_pos = vec2(atan2(dir_2d.x, dir_2d.y), z);
vec3 cam_wpos = cam_pos.xyz + focus_off.xyz;
float rain_density = rain_density_at(cam_wpos.xy) * 100.0;
float rain_density = rain_density_at(cam_wpos.xy) * 10.0;
if (rain_density > 0) {
float rain_dist = 50.0;
for (int i = 0; i < 5; i ++) {
@ -125,7 +125,7 @@ void main() {
continue;
}
float drop_density = 3;
vec2 drop_density = vec2(30, 3);
vec2 drop_size = vec2(0.0015, 0.17);
vec2 rain_pos = (view_pos * rain_dist);

View File

@ -152,7 +152,7 @@ void main() {
#ifdef EXPERIMENTAL_RAIN
float rain_density = rain_density_at(cam_pos.xy + focus_off.xy) * 100.0;
if (rain_density > 0 && surf_norm.z > 0.5) {
vec3 drop_density = vec3(2, 2, 1);
vec3 drop_density = vec3(2, 2, 2);
vec3 drop_pos = wave_pos + vec3(0, 0, -time_of_day.x * 0.025);
drop_pos.z += noise_2d(floor(drop_pos.xy * drop_density.xy) * 13.1) * 10;
vec2 cell2d = floor(drop_pos.xy * drop_density.xy);

View File

@ -235,7 +235,7 @@ void main() {
float rain_density = rain_density_at(cam_pos.xy + focus_off.xy) * 100.0;
if (rain_density > 0 && !faces_fluid && f_norm.z > 0.5) {
vec3 pos = f_pos + focus_off.xyz;
vec3 drop_density = vec3(2, 2, 1);
vec3 drop_density = vec3(2, 2, 2);
vec3 drop_pos = pos + vec3(pos.zz, 0) + vec3(0, 0, -tick.x * 1.0);
drop_pos.z += noise_2d(floor(drop_pos.xy * drop_density.xy) * 13.1) * 10;
vec2 cell2d = floor(drop_pos.xy * drop_density.xy);

View File

@ -176,9 +176,11 @@ impl WeatherSim {
for (point, cell) in self.weather.iter_mut() {
let wpos = cell_to_wpos(point);
let space_scale = 7500.0;
let time_scale = 25000.0;
let spos = (wpos.as_::<f64>() / space_scale).with_z(time as f64 / time_scale);
let pos = wpos.as_::<f64>() + time as f64 * 0.25;
let space_scale = 7_500.0;
let time_scale = 100_000.0;
let spos = (pos / space_scale).with_z(time as f64 / time_scale);
let pressure = (base_nz.get(spos.into_array()) * 0.5 + 1.0).clamped(0.0, 1.0) as f32;
@ -187,7 +189,8 @@ impl WeatherSim {
cell.wind = Vec2::new(
rain_nz.get(spos.into_array()) as f32,
rain_nz.get((spos + 1.0).into_array()) as f32,
) * 250.0 * (1.0 - pressure);
) * 250.0
* (1.0 - pressure);
}
/*
let mut swap = Grid::new(self.cells.size(), Cell::default());