mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
weather change test
This commit is contained in:
parent
589518fb25
commit
02d8d8d6bf
7 changed files with 83 additions and 41 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue