diff options
author | Henri Beauchamp <sldev@free.fr> | 2024-02-07 21:40:17 +0100 |
---|---|---|
committer | Henri Beauchamp <sldev@free.fr> | 2024-02-07 21:40:17 +0100 |
commit | 1940188e75806ffdd60807017210092b0dbe0dcf (patch) | |
tree | 4bd3283bfa48b4abe12916a907ec48a7cef3896d | |
parent | edb2fb57f8782f966c7ea675d2e4c0135352ef02 (diff) |
Confusion between light diffuse and light color in HDR auto-adjust mode
While the SUNLIGHT_COLOR uniform is initialized with getSunlightColor() when not
auto-adjusting for HDR, it is overwritten with getSunDiffuse()*auto_adjust_factor
when auto-adjusting, causing very bad lighting discrepancies in the latter mode
(especially when not at midday or midnight).
Let's use getSunlightColor() everywhere, shall we ?...
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 7009fb98ab..17405ca864 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -718,11 +718,11 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); // TODO -- make these getters return vec3s - LLVector3 sunDiffuse = LLVector3(psky->getSunlightColor().mV); - LLVector3 moonDiffuse = LLVector3(psky->getMoonlightColor().mV); + LLVector3 sun_light_color = LLVector3(psky->getSunlightColor().mV); + LLVector3 moon_light_color = LLVector3(psky->getMoonlightColor().mV); - shader->uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, sunDiffuse); - shader->uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, moonDiffuse); + shader->uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, sun_light_color); + shader->uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, moon_light_color); shader->uniform3fv(LLShaderMgr::CLOUD_COLOR, LLVector3(psky->getCloudColor().mV)); @@ -766,9 +766,9 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, auto_adjust_hdr_scale); 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; + sun_light_color = sun_light_color * auto_adjust_sun_color_scale; - shader->uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, sun_diffuse.mV); + shader->uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, sun_light_color.mV); shader->uniform3fv(LLShaderMgr::BLUE_DENSITY, blue_density.mV); shader->uniform3fv(LLShaderMgr::BLUE_HORIZON, blue_horizon.mV); |