mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01: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
|
|
@ -23,6 +23,9 @@ dv::value WeatherPreset::serialize() const {
|
|||
root["fog_opacity"] = fogOpacity;
|
||||
root["fog_dencity"] = fogDencity;
|
||||
root["fog_curve"] = fogCurve;
|
||||
root["sky_tint"] = dv::to_value(skyTint);
|
||||
root["clouds_tint"] = dv::to_value(cloudsTint);
|
||||
root["min_sky_light"] = dv::to_value(minSkyLight);
|
||||
root["clouds"] = clouds;
|
||||
root["thunder_rate"] = thunderRate;
|
||||
|
||||
|
|
@ -51,6 +54,9 @@ void WeatherPreset::deserialize(const dv::value& src) {
|
|||
src.at("fog_opacity").get(fogOpacity);
|
||||
src.at("fog_dencity").get(fogDencity);
|
||||
src.at("fog_curve").get(fogCurve);
|
||||
dv::get_vec(src, "sky_tint", skyTint);
|
||||
dv::get_vec(src, "clouds_tint", cloudsTint);
|
||||
dv::get_vec(src, "min_sky_light", minSkyLight);
|
||||
src.at("clouds").get(clouds);
|
||||
src.at("thunder_rate").get(thunderRate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,15 @@ struct WeatherPreset : Serializable {
|
|||
/// @brief Weather effects intensity
|
||||
float intensity = 0.0f;
|
||||
|
||||
/// @brief Skybox color multiplier
|
||||
glm::vec3 skyTint {1.0f, 1.0f, 1.0f};
|
||||
|
||||
/// @brief Clouds color multiplier
|
||||
glm::vec3 cloudsTint {1.0f, 1.0f, 1.0f};
|
||||
|
||||
/// @brief Minimal sky-emitted lights (moon light)
|
||||
glm::vec3 minSkyLight {0.2f, 0.25f, 0.33f};
|
||||
|
||||
dv::value serialize() const override;
|
||||
void deserialize(const dv::value& src) override;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue