add fall.max_opacity, fall.opaque properties & update snow texture & weather mix test

This commit is contained in:
MihailRis
2025-02-26 06:24:05 +03:00
parent 18773b3230
commit 589518fb25
9 changed files with 57 additions and 21 deletions
+6
View File
@@ -11,6 +11,9 @@ dv::value WeatherPreset::serialize() const {
froot["hspeed"] = fall.hspeed;
froot["scale"] = fall.scale;
froot["noise"] = fall.noise;
froot["min_opacity"] = fall.minOpacity;
froot["max_opacity"] = fall.maxOpacity;
froot["opaque"] = fall.opaque;
if (fall.splash) {
froot["splash"] = fall.splash->serialize();
}
@@ -32,6 +35,9 @@ 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);
froot.at("min_opacity").get(fall.minOpacity);
froot.at("max_opacity").get(fall.maxOpacity);
froot.at("opaque").get(fall.opaque);
if (froot.has("splash")) {
const auto& sroot = froot["splash"];
+3 -1
View File
@@ -20,7 +20,9 @@ struct WeatherPreset : Serializable {
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;
float minOpacity = 0.0f;
float maxOpacity = 1.0f;
bool opaque = false;
/// @brief Fall splash
std::optional<ParticlesPreset> splash;
} fall {};