add 'sky_tint', 'clouds_tint', 'min_sky_light' weather parameters

This commit is contained in:
MihailRis 2026-02-12 20:27:29 +03:00
parent 1194379f99
commit e037462615
22 changed files with 80 additions and 31 deletions

View file

@ -12,6 +12,7 @@ struct Weather : Serializable {
std::string nameB;
float t = 1.0f;
float speed = 0.0f;
glm::vec3 highlight {};
void update(float delta) {
t += delta * speed;
@ -51,6 +52,18 @@ struct Weather : Serializable {
return b.clouds * sqrtT + a.clouds * (1.0f - sqrtT);
}
glm::vec3 skyTint() const {
return b.skyTint * t + a.skyTint * (1.0f - t);
}
glm::vec3 cloudsTint() const {
return b.cloudsTint * t + a.cloudsTint * (1.0f - t);
}
glm::vec3 minSkyLight() const {
return b.minSkyLight * t + a.minSkyLight * (1.0f - t);
}
dv::value serialize() const override;
void deserialize(const dv::value& src) override;
};