From 1044443e9b6ccf77721d08121101f3f540b56981 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Wed, 8 Apr 2026 12:27:08 +0300 Subject: [PATCH] Weather sim v2: make land & water heating speed differ --- examples/weather_v2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/weather_v2.cpp b/examples/weather_v2.cpp index dc6095c9..8ec8bddc 100644 --- a/examples/weather_v2.cpp +++ b/examples/weather_v2.cpp @@ -274,7 +274,7 @@ struct solver math::point p{x + 0.5f, y + 0.5f}; float advection = sample_bilinear(snapshot.temperature, p - snapshot.wind_velocity(x, y) * step_time); - float heating_speed = 0.001f; + float heating_speed = (terrain(x, y) < 0.f) ? 0.001f : 0.0001f; float heating_delta = (expected_temperature(y) - snapshot.temperature(x, y)) * (- std::expm1(- heating_speed * step_time)); new_temperature(x, y) = heating_delta + advection; @@ -396,7 +396,7 @@ struct weather_app simulation_box = {{{0.f, N}, {0.f, N}}}; terrain.resize({N, N}, 0.f); - auto heightmap = gfx::read_image(io::file_istream{std::filesystem::path{PSEMEK_EXAMPLES_DIR} / "heightmap_seed_3.png"}); + auto heightmap = gfx::read_image(io::file_istream{std::filesystem::path{PSEMEK_EXAMPLES_DIR} / "heightmap_seed_1.png"}); for (int y = 0; y < N; ++y) for (int x = 0; x < N; ++x) terrain(x, y) = ((heightmap(x, y) / 255.f) * 2048.f - 512.f) / 1024.f;