summaryrefslogtreecommitdiff
path: root/indra/newview/llsettingsvo.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-10-13 14:02:51 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-10-13 14:02:51 -0700
commita91f08ba84844647bbcdecac11e85c449579527c (patch)
tree9bfdc77c9e7de33413b95f2648cb139b19cb06f0 /indra/newview/llsettingsvo.cpp
parentcc0f831aaa960552b218da436da57b44cb2dfe0f (diff)
parentcba71633559ccdfd394983a6086da816e739a730 (diff)
Merge branch 'DRTVWR-559' into DRTVWR-592
Diffstat (limited to 'indra/newview/llsettingsvo.cpp')
-rw-r--r--indra/newview/llsettingsvo.cpp42
1 files changed, 37 insertions, 5 deletions
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 264359a3a9..42587658a6 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -97,6 +97,20 @@ namespace
//=========================================================================
+void LLSettingsVOBase::createNewInventoryItem(LLSettingsType::type_e stype, const LLUUID& parent_id, std::function<void(const LLUUID&)> created_cb)
+{
+ inventory_result_fn cb = NULL;
+
+ if (created_cb != NULL)
+ {
+ cb = [created_cb](LLUUID asset_id, LLUUID inventory_id, LLUUID object_id, LLSD results)
+ {
+ created_cb(inventory_id);
+ };
+ }
+ createNewInventoryItem(stype, parent_id, cb);
+}
+
void LLSettingsVOBase::createNewInventoryItem(LLSettingsType::type_e stype, const LLUUID &parent_id, inventory_result_fn callback)
{
LLTransactionID tid;
@@ -318,7 +332,7 @@ void LLSettingsVOBase::onAssetDownloadComplete(const LLUUID &asset_id, S32 statu
std::stringstream llsdstream(buffer);
LLSD llsdsettings;
- if (LLSDSerialize::deserialize(llsdsettings, llsdstream, -1))
+ if (LLSDSerialize::deserialize(llsdsettings, llsdstream, LLSDSerialize::SIZE_UNLIMITED))
{
settings = createFromLLSD(llsdsettings);
}
@@ -385,7 +399,7 @@ LLSettingsBase::ptr_t LLSettingsVOBase::importFile(const std::string &filename)
return LLSettingsBase::ptr_t();
}
- if (!LLSDSerialize::deserialize(settings, file, -1))
+ if (!LLSDSerialize::deserialize(settings, file, LLSDSerialize::SIZE_UNLIMITED))
{
LL_WARNS("SETTINGS") << "Unable to deserialize settings from '" << filename << "'" << LL_ENDL;
return LLSettingsBase::ptr_t();
@@ -721,6 +735,15 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<F32> auto_adjust_ambient_scale(gSavedSettings, "RenderSkyAutoAdjustAmbientScale", 0.75f);
static LLCachedControl<F32> auto_adjust_hdr_scale(gSavedSettings, "RenderSkyAutoAdjustHDRScale", 2.f);
+ static LLCachedControl<F32> auto_adjust_blue_horizon_scale(gSavedSettings, "RenderSkyAutoAdjustBlueHorizonScale", 1.f);
+ static LLCachedControl<F32> auto_adjust_blue_density_scale(gSavedSettings, "RenderSkyAutoAdjustBlueDensityScale", 1.f);
+ static LLCachedControl<F32> auto_adjust_sun_color_scale(gSavedSettings, "RenderSkyAutoAdjustSunColorScale", 1.f);
+ static LLCachedControl<F32> auto_adjust_probe_ambiance(gSavedSettings, "RenderSkyAutoAdjustProbeAmbiance", 1.f);
+ static LLCachedControl<F32> sunlight_scale(gSavedSettings, "RenderSkySunlightScale", 1.5f);
+ static LLCachedControl<F32> ambient_scale(gSavedSettings, "RenderSkyAmbientScale", 1.5f);
+
+ shader->uniform1f(LLShaderMgr::SKY_SUNLIGHT_SCALE, sunlight_scale);
+ shader->uniform1f(LLShaderMgr::SKY_AMBIENT_SCALE, ambient_scale);
static LLCachedControl<F32> cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f);
F32 probe_ambiance = getTotalReflectionProbeAmbiance(cloud_shadow_scale);
@@ -733,14 +756,23 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
{
if (psky->getReflectionProbeAmbiance() != 0.f)
{
- shader->uniform3fv(LLShaderMgr::AMBIENT, getAmbientColor().mV);
+ shader->uniform3fv(LLShaderMgr::AMBIENT, LLVector3(ambient.mV));
shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, sqrtf(g)*2.0); // use a modifier here so 1.0 maps to the "most desirable" default and the maximum value doesn't go off the rails
}
else if (psky->canAutoAdjust() && should_auto_adjust)
{ // auto-adjust legacy sky to take advantage of probe ambiance
shader->uniform3fv(LLShaderMgr::AMBIENT, (ambient * auto_adjust_ambient_scale).mV);
shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, auto_adjust_hdr_scale);
- probe_ambiance = 1.f; // NOTE -- must match LLSettingsSky::getReflectionProbeAmbiance value for "auto_adjust" true
+ LLColor3 blue_horizon = getBlueHorizon() * auto_adjust_blue_horizon_scale;
+ LLColor3 blue_density = getBlueDensity() * auto_adjust_blue_density_scale;
+ LLColor3 sun_diffuse = getSunDiffuse() * auto_adjust_sun_color_scale;
+
+ shader->uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, sun_diffuse.mV);
+ shader->uniform3fv(LLShaderMgr::BLUE_DENSITY, blue_density.mV);
+ shader->uniform3fv(LLShaderMgr::BLUE_HORIZON, blue_horizon.mV);
+
+ LLSettingsSky::sAutoAdjustProbeAmbiance = auto_adjust_probe_ambiance;
+ probe_ambiance = auto_adjust_probe_ambiance; // NOTE -- must match LLSettingsSky::getReflectionProbeAmbiance value for "auto_adjust" true
}
else
{
@@ -755,7 +787,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
shader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, getSunMoonGlowFactor());
shader->uniform1f(LLShaderMgr::DENSITY_MULTIPLIER, getDensityMultiplier());
shader->uniform1f(LLShaderMgr::DISTANCE_MULTIPLIER, getDistanceMultiplier());
-
+
shader->uniform1f(LLShaderMgr::GAMMA, g);
}