diff options
| author | RunitaiLinden <davep@lindenlab.com> | 2023-08-22 13:17:58 -0500 | 
|---|---|---|
| committer | RunitaiLinden <davep@lindenlab.com> | 2023-08-22 13:17:58 -0500 | 
| commit | 894c9e0417e7b29aaf31c673ca040dff93eb36ef (patch) | |
| tree | 837909a91622d7c06c9484acece1049ec3c73695 /indra/newview | |
| parent | ec1d1f43540bac02e6cd2e814ee14da0cd33a67c (diff) | |
SL-19842 WIP -- Move sky auto adjustment magic numbers to debug settings.
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 67 | ||||
| -rw-r--r-- | indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl | 6 | ||||
| -rw-r--r-- | indra/newview/llsettingsvo.cpp | 22 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 4 | 
4 files changed, 93 insertions, 6 deletions
| diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0cd63d9d5f..4612ee1a82 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10656,6 +10656,73 @@      <key>Value</key>      <real>2.0</real>    </map> +  <key>RendeSkyAutoAdjustBlueHorizonScale</key> +  <map> +    <key>Comment</key> +    <string>Blue Horizon Scale value to use when auto-adjusting legacy skies</string> +    <key>Persist</key> +    <integer>1</integer> +    <key>Type</key> +    <string>F32</string> +    <key>Value</key> +    <real>1.0</real> +  </map> +  <key>RendeSkyAutoAdjustBlueDensityScale</key> +  <map> +    <key>Comment</key> +    <string>Blue Horizon Scale value to use when auto-adjusting legacy skies</string> +    <key>Persist</key> +    <integer>1</integer> +    <key>Type</key> +    <string>F32</string> +    <key>Value</key> +    <real>1.0</real> +  </map> +  <key>RenderSkyAutoAdjustSunColorScale</key> +  <map> +    <key>Comment</key> +    <string>Sun color scalar when auto-adjusting legacy skies</string> +    <key>Persist</key> +    <integer>1</integer> +    <key>Type</key> +    <string>F32</string> +    <key>Value</key> +    <real>1.0</real> +  </map> +  <key>RenderSkyAutoAdjustProbeAmbiance</key> +  <map> +    <key>Comment</key> +    <string>Probe ambiance value when auto-adjusting legacy skies</string> +    <key>Persist</key> +    <integer>1</integer> +    <key>Type</key> +    <string>F32</string> +    <key>Value</key> +    <real>1.0</real> +  </map> +  <key>RenderSkySunlightScale</key> +  <map> +    <key>Comment</key> +    <string>Sunlight scale fudge factor for matching with pre-PBR viewer</string> +    <key>Persist</key> +    <integer>1</integer> +    <key>Type</key> +    <string>F32</string> +    <key>Value</key> +    <real>1.5</real> +  </map> +  <key>RenderSkyAmbientScale</key> +  <map> +    <key>Comment</key> +    <string>Ambient scale fudge factor for matching with pre-PBR viewer</string> +    <key>Persist</key> +    <integer>1</integer> +    <key>Type</key> +    <string>F32</string> +    <key>Value</key> +    <real>0.5</real> +  </map> +      <key>RenderReflectionProbeMaxLocalLightAmbiance</key>    <map>      <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl index 437fa0a6d5..53474ded7f 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -40,6 +40,8 @@ uniform vec3  glow;  uniform float scene_light_strength;  uniform float sun_moon_glow_factor;  uniform float sky_hdr_scale; +uniform float sky_sunlight_scale; +uniform float sky_ambient_scale;  float getAmbientClamp() { return 1.0f; } @@ -148,8 +150,8 @@ void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, ou      // multiply to get similar colors as when the "scaleSoftClip" implementation was doubling color values      // (allows for mixing of light sources other than sunlight e.g. reflection probes) -    sunlit *= 1.5; -    amblit *= 0.5; +    sunlit *= sky_sunlight_scale; //1.5; +    amblit *= sky_ambient_scale; //0.5;      // override amblit with ambient_color if sky probe ambiance is not zero      amblit = mix(amblit, ambient_color, clamp(sky_hdr_scale-1.0, 0.0, 1.0)); diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 264359a3a9..9ccac82e63 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -721,6 +721,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); @@ -740,7 +749,16 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)          { // 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 +773,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);  } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1620b1ff4c..0b5908a440 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7730,8 +7730,8 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_  		shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_NORM_MATRIX, 1, FALSE, norm_mat.m);  	} -    shader.uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, mSunDiffuse.mV); -    shader.uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, 1, mMoonDiffuse.mV); +    //shader.uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, mSunDiffuse.mV); +    //shader.uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, 1, mMoonDiffuse.mV);      shader.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mReflectionMapManager.mMaxProbeLOD);  } | 
