mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
add 'sky_tint', 'clouds_tint', 'min_sky_light' weather parameters
This commit is contained in:
parent
1194379f99
commit
e037462615
22 changed files with 80 additions and 31 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue