summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2023-05-17 11:31:45 -0700
committerCallum Prentice <callum@lindenlab.com>2023-05-17 11:31:45 -0700
commitf45e888c903bc7a4953b2812e6c30721a4322d1b (patch)
treedc76eefe00474e27ad2981f0d922fec617d1b9ad /indra/llinventory
parent671978e3927bc3ba9fc34008bbb7efd6f07b6c81 (diff)
parent5a70639b7992842a9f74ec81b11bac56608b8f2e (diff)
Some small tweaks after merge with Viewer release
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp4
-rw-r--r--indra/llinventory/llsettingswater.cpp13
2 files changed, 15 insertions, 2 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index 241826604f..42dd5e3d10 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -440,8 +440,8 @@ LLSD LLSettingsDay::defaults()
}
LLSD tracks;
- tracks.append(LLSDArray(waterTrack));
- tracks.append(LLSDArray(skyTrack));
+ tracks.append(llsd::array(waterTrack));
+ tracks.append(llsd::array(skyTrack));
dfltsetting[SETTING_TRACKS] = tracks;
dfltsetting[SETTING_FRAMES] = frames;
diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp
index f19beb5be5..d732032a6c 100644
--- a/indra/llinventory/llsettingswater.cpp
+++ b/indra/llinventory/llsettingswater.cpp
@@ -286,6 +286,19 @@ F32 LLSettingsWater::getModifiedWaterFogDensity(bool underwater) const
if (underwater && underwater_fog_mod > 0.0f)
{
underwater_fog_mod = llclamp(underwater_fog_mod, 0.0f, 10.0f);
+ // BUG-233797/BUG-233798 -ve underwater fog density can cause (unrecoverable) blackout.
+ // raising a negative number to a non-integral power results in a non-real result (which is NaN for our purposes)
+ // Two methods were tested, number 2 is being used:
+ // 1) Force the fog_mod to be integral. The effect is unlikely to be nice, but it is better than blackness.
+ // In this method a few of the combinations are "usable" but the water colour is effectively inverted (blue becomes yellow)
+ // this seems to be unlikely to be a desirable use case for the majority.
+ // 2) Force density to be an arbitrary non-negative (i.e. 1) when underwater and modifier is not an integer (1 was aribtrarily chosen as it gives at least some notion of fog in the transition)
+ // This is more restrictive, effectively forcing a density under certain conditions, but allowing the range of #1 and avoiding blackness in other cases
+ // at the cost of overriding the fog density.
+ if(fog_density < 0.0f && underwater_fog_mod != (F32)llround(underwater_fog_mod) )
+ {
+ fog_density = 1.0f;
+ }
fog_density = pow(fog_density, underwater_fog_mod);
}
return fog_density;