add weather intensity (WIP)

This commit is contained in:
MihailRis
2025-02-26 02:24:16 +03:00
parent 830e05733f
commit fe503d1192
5 changed files with 38 additions and 6 deletions
+6
View File
@@ -12,6 +12,9 @@ dv::value WeatherPreset::serialize() const {
froot["scale"] = fall.scale;
froot["noise"] = fall.noise;
root["fall"] = froot;
root["fog_opacity"] = fogOpacity;
root["fog_dencity"] = fogDencity;
root["clouds"] = clouds;
return root;
}
@@ -24,5 +27,8 @@ void WeatherPreset::deserialize(const dv::value& src) {
froot.at("hspeed").get(fall.hspeed);
froot.at("scale").get(fall.scale);
froot.at("noise").get(fall.noise);
src.at("fog_opacity").get(fogOpacity);
src.at("fog_dencity").get(fogDencity);
src.at("clouds").get(clouds);
}
}
+14
View File
@@ -18,10 +18,24 @@ struct WeatherPreset : Serializable {
float hspeed = 0.1f;
/// @brief UV scaling
float scale = 0.1f;
/// @brief Fall opacity interpreted as zero.
/// @example if 0.8 then opacity range is 0.8-1.0 for 0.0-1.0 intensity
float minOpacity = 0.8f;
/// @brief Fall splash
std::optional<ParticlesPreset> splash;
} fall {};
/// @brief Max weather fog opacity
float fogOpacity = 0.8f;
/// @brief Weather fog depth multiplier
float fogDencity = 2.0f;
float clouds = 0.5f;
/// @brief Weather effects intensity
float intensity = 0.9f;
dv::value serialize() const override;
void deserialize(const dv::value& src) override;
};