weather change test
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user