diff options
author | RunitaiLinden <davep@lindenlab.com> | 2024-01-19 11:36:56 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-19 11:36:56 -0600 |
commit | 6dd260c3699148b4ddf8e7bff84f4b19f8bbf076 (patch) | |
tree | 6c9144f701ecb2cda859baaeed4e2f4ee6f9a683 /indra/newview/llsettingsvo.cpp | |
parent | 45547c7bbadf15804f54bb28fd1c94eb5f080bf5 (diff) | |
parent | 09ee84f675cf08f98cbd49516c5e01c289b42a20 (diff) |
Merge branch 'release/materials_featurette' into DRTVWR-592
Diffstat (limited to 'indra/newview/llsettingsvo.cpp')
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 42587658a6..c07c939862 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -63,6 +63,7 @@ #include <boost/algorithm/string/replace.hpp> #include "llinventoryobserver.h" #include "llinventorydefines.h" +#include "llworld.h" #include "lltrans.h" @@ -738,7 +739,6 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) 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); @@ -771,8 +771,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) 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 + probe_ambiance = sAutoAdjustProbeAmbiance; } else { @@ -983,12 +982,21 @@ void LLSettingsVOWater::applySpecial(void *ptarget, bool force) LLEnvironment& env = LLEnvironment::instance(); - auto group = LLGLSLShader::SG_WATER; + auto group = LLGLSLShader::SG_ANY; LLShaderUniforms* shader = &((LLShaderUniforms*)ptarget)[group]; { F32 water_height = env.getWaterHeight(); + if (LLViewerCamera::instance().cameraUnderWater()) + { // when the camera is under water, use the water height at the camera position + LLViewerRegion* region = LLWorld::instance().getRegionFromPosAgent(LLViewerCamera::instance().getOrigin()); + if (region) + { + water_height = region->getWaterHeight(); + } + } + //transform water plane to eye space glh::vec3f norm(0.f, 0.f, 1.f); glh::vec3f p(0.f, 0.f, water_height); |