weather change test

This commit is contained in:
MihailRis
2025-02-26 12:19:47 +03:00
parent 589518fb25
commit 02d8d8d6bf
7 changed files with 83 additions and 41 deletions
+27 -1
View File
@@ -34,6 +34,32 @@ class ModelBatch;
class Assets;
struct EngineSettings;
struct Weather {
WeatherPreset a {};
WeatherPreset b {};
float t = 1.0f;
float speed = 0.0f;
void update(float delta) {
t += delta * speed;
t = std::min(t, 1.0f);
b.intensity = t;
a.intensity = 1.0f - t;
}
float fogOpacity() const {
return b.fogOpacity * t + a.fogOpacity * (1.0f - t);
}
float fogDencity() const {
return b.fogDencity * t + a.fogDencity * (1.0f - t);
}
float fogCurve() const {
return b.fogCurve * t + a.fogCurve * (1.0f - t);
}
};
class WorldRenderer {
Engine& engine;
const Level& level;
@@ -75,7 +101,7 @@ public:
std::unique_ptr<ParticlesRenderer> particles;
std::unique_ptr<BlockWrapsRenderer> blockWraps;
std::unique_ptr<PrecipitationRenderer> precipitation;
std::vector<WeatherPreset> weatherInstances;
Weather weather {};
static bool showChunkBorders;
static bool showEntitiesDebug;