From 50ec54831de88926ca13c9a72d89006ceda6c355 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Thu, 1 Jun 2023 19:49:23 -0500 Subject: DRTVWR-559 Revert skies to be very close to release and disable tone mapping when probe ambiance is zero. Hack for desaturating legacy materials has been removed for performance and quality reasons. Adds a new setting for auto adjusting legacy skies. This is the PBR "opt out" button. If disabled, legacy skies will disable tonemapping, automatic probe ambiance, and HDR/exposure. If enabled, legacy skies will behave as if probe ambiance and HDR scale are 1.0, and ambient will be cut in half. HDR scale will act as a sky brightener, but will automatically adjust dynamic exposure so the sky will be properly exposed. If you want relatively even exposure all the time, set HDR Scale to 1.0. If you want a high range of exposures between indoor/dark areas and outdoor/bright areas, increase HDR Scale. Also tuned up SSAO (thanks Rye!). Reviewed with Brad. --- indra/llinventory/llsettingssky.cpp | 17 +- indra/llinventory/llsettingssky.h | 13 +- indra/llrender/llshadermgr.cpp | 11 +- indra/llrender/llshadermgr.h | 7 +- indra/newview/app_settings/settings.xml | 51 +++--- .../shaders/class1/deferred/fullbrightF.glsl | 4 +- .../class1/deferred/postDeferredGammaCorrect.glsl | 20 ++- .../shaders/class1/environment/srgbF.glsl | 13 ++ .../shaders/class1/windlight/atmosphericsF.glsl | 54 +++++++ .../class1/windlight/atmosphericsFuncs.glsl | 159 ++++++++++++++++++ .../class1/windlight/atmosphericsHelpersF.glsl | 44 +++++ .../class1/windlight/atmosphericsHelpersV.glsl | 57 +++++++ .../shaders/class1/windlight/atmosphericsV.glsl | 56 +++++++ .../class1/windlight/atmosphericsVarsF.glsl | 48 ++++++ .../class1/windlight/atmosphericsVarsV.glsl | 84 ++++++++++ .../class1/windlight/atmosphericsVarsWaterF.glsl | 50 ++++++ .../class1/windlight/atmosphericsVarsWaterV.glsl | 81 ++++++++++ .../shaders/class1/windlight/gammaF.glsl | 55 +++++++ .../shaders/class2/windlight/atmosphericsF.glsl | 54 ------- .../class2/windlight/atmosphericsFuncs.glsl | 178 --------------------- .../class2/windlight/atmosphericsHelpersF.glsl | 44 ----- .../class2/windlight/atmosphericsHelpersV.glsl | 57 ------- .../shaders/class2/windlight/atmosphericsV.glsl | 56 ------- .../class2/windlight/atmosphericsVarsF.glsl | 48 ------ .../class2/windlight/atmosphericsVarsV.glsl | 84 ---------- .../class2/windlight/atmosphericsVarsWaterF.glsl | 50 ------ .../class2/windlight/atmosphericsVarsWaterV.glsl | 81 ---------- .../shaders/class2/windlight/gammaF.glsl | 55 ------- .../shaders/class3/deferred/fullbrightShinyF.glsl | 4 +- .../shaders/class3/deferred/softenLightF.glsl | 36 +++-- indra/newview/featuretable.txt | 4 +- indra/newview/featuretable_mac.txt | 4 +- indra/newview/llenvironment.cpp | 13 +- indra/newview/llfloaterenvironmentadjust.cpp | 18 +++ indra/newview/llfloaterenvironmentadjust.h | 2 +- indra/newview/llpaneleditsky.cpp | 20 +++ indra/newview/llpaneleditsky.h | 1 + indra/newview/llreflectionmapmanager.cpp | 3 +- indra/newview/llsettingsvo.cpp | 35 ++-- indra/newview/llviewermedia.cpp | 2 +- indra/newview/llviewertexture.cpp | 14 -- indra/newview/llviewertexture.h | 1 - indra/newview/pipeline.cpp | 43 +++-- .../default/xui/en/floater_adjust_environment.xml | 40 ++--- .../en/floater_preferences_graphics_advanced.xml | 14 ++ .../default/xui/en/panel_settings_sky_atmos.xml | 51 +++--- 46 files changed, 949 insertions(+), 887 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index eb8385281c..6521ec8b43 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -403,6 +403,7 @@ LLSettingsSky::LLSettingsSky(const LLSD &data) : mNextRainbowTextureId(), mNextHaloTextureId() { + mCanAutoAdjust = !data.has(SETTING_REFLECTION_PROBE_AMBIANCE); } LLSettingsSky::LLSettingsSky(): @@ -425,6 +426,8 @@ void LLSettingsSky::replaceSettings(LLSD settings) mNextBloomTextureId.setNull(); mNextRainbowTextureId.setNull(); mNextHaloTextureId.setNull(); + + mCanAutoAdjust = !settings.has(SETTING_REFLECTION_PROBE_AMBIANCE); } void LLSettingsSky::replaceWithSky(LLSettingsSky::ptr_t pother) @@ -437,6 +440,7 @@ void LLSettingsSky::replaceWithSky(LLSettingsSky::ptr_t pother) mNextBloomTextureId = pother->mNextBloomTextureId; mNextRainbowTextureId = pother->mNextRainbowTextureId; mNextHaloTextureId = pother->mNextHaloTextureId; + mCanAutoAdjust = pother->mCanAutoAdjust; } void LLSettingsSky::blend(const LLSettingsBase::ptr_t &end, F64 blendf) @@ -1429,18 +1433,23 @@ F32 LLSettingsSky::getSkyIceLevel() const return mSettings[SETTING_SKY_ICE_LEVEL].asReal(); } -F32 LLSettingsSky::getReflectionProbeAmbiance() const +F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const { + if (auto_adjust && canAutoAdjust()) + { + return 1.f; + } + return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal(); } -F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const +F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale, bool auto_adjust) const { // feed cloud shadow back into reflection probe ambiance to mimic pre-reflection-probe behavior // without brightening dark/interior spaces - F32 probe_ambiance = getReflectionProbeAmbiance(); + F32 probe_ambiance = getReflectionProbeAmbiance(auto_adjust); - if (probe_ambiance > 0.f) + if (probe_ambiance > 0.f && probe_ambiance < 1.f) { probe_ambiance += (1.f - probe_ambiance) * getCloudShadow() * cloud_shadow_scale; } diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 7ae569dd4c..f55e9f0631 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -134,10 +134,12 @@ public: F32 getSkyIceLevel() const; // get the probe ambiance setting as stored in the sky settings asset - F32 getReflectionProbeAmbiance() const; + // auto_adjust - if true and canAutoAdjust() is true, return 1.0 + F32 getReflectionProbeAmbiance(bool auto_adjust = false) const; // get the probe ambiance setting to use for rendering (adjusted by cloud shadow, aka cloud coverage) - F32 getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const; + // auto_adjust - if true and canAutoAdjust() is true, return 1.0 + F32 getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale, bool auto_adjust = false) const; // Return first (only) profile layer represented in LLSD LLSD getRayleighConfig() const; @@ -334,6 +336,10 @@ public: F32 aniso_factor = 0.0f); virtual void updateSettings() SETTINGS_OVERRIDE; + + // if true, this sky is a candidate for auto-adjustment + bool canAutoAdjust() const { return mCanAutoAdjust; } + protected: static const std::string SETTING_LEGACY_EAST_ANGLE; static const std::string SETTING_LEGACY_ENABLE_CLOUD_SCROLL; @@ -377,6 +383,9 @@ private: mutable LLColor4 mTotalAmbient; mutable LLColor4 mHazeColor; + // if true, this sky is a candidate for auto adjustment + bool mCanAutoAdjust = true; + typedef std::map mapNameToUniformId_t; static mapNameToUniformId_t sNameToUniformMapping; diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 01bad3a684..f398526b41 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1266,13 +1266,11 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("lightnorm"); mReservedUniforms.push_back("sunlight_color"); mReservedUniforms.push_back("ambient_color"); + mReservedUniforms.push_back("sky_hdr_scale"); mReservedUniforms.push_back("blue_horizon"); - mReservedUniforms.push_back("blue_horizon_linear"); - mReservedUniforms.push_back("blue_density"); - mReservedUniforms.push_back("blue_density_linear"); - mReservedUniforms.push_back("haze_horizon"); + mReservedUniforms.push_back("blue_density"); + mReservedUniforms.push_back("haze_horizon"); mReservedUniforms.push_back("haze_density"); - mReservedUniforms.push_back("haze_density_linear"); mReservedUniforms.push_back("cloud_shadow"); mReservedUniforms.push_back("density_multiplier"); mReservedUniforms.push_back("distance_multiplier"); @@ -1460,9 +1458,6 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("water_edge"); mReservedUniforms.push_back("sun_up_factor"); mReservedUniforms.push_back("moonlight_color"); - mReservedUniforms.push_back("moonlight_linear"); - mReservedUniforms.push_back("sunlight_linear"); - mReservedUniforms.push_back("ambient_linear"); llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS); diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 8c19c80cb0..5d7ab7c53d 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -102,13 +102,11 @@ public: LIGHTNORM, // "lightnorm" SUNLIGHT_COLOR, // "sunlight_color" AMBIENT, // "ambient_color" + SKY_HDR_SCALE, // "sky_hdr_scale" BLUE_HORIZON, // "blue_horizon" - BLUE_HORIZON_LINEAR, // "blue_horizon_linear" BLUE_DENSITY, // "blue_density" - BLUE_DENSITY_LINEAR, // "blue_density_linear" HAZE_HORIZON, // "haze_horizon" HAZE_DENSITY, // "haze_density" - HAZE_DENSITY_LINEAR, // "haze_density_linear" CLOUD_SHADOW, // "cloud_shadow" DENSITY_MULTIPLIER, // "density_multiplier" DISTANCE_MULTIPLIER, // "distance_multiplier" @@ -285,9 +283,6 @@ public: WATER_EDGE_FACTOR, // "water_edge" SUN_UP_FACTOR, // "sun_up_factor" MOONLIGHT_COLOR, // "moonlight_color" - MOONLIGHT_LINEAR, // "moonlight_LINEAR" - SUNLIGHT_LINEAR, // "sunlight_linear" - AMBIENT_LINEAR, // "ambient_linear" END_RESERVED_UNIFORMS } eGLSLReservedUniforms; // clang-format on diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 79e150a6f2..f27444ca27 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9116,6 +9116,28 @@ Value 500.0 + RenderSSAOIrradianceScale + + Comment + Scaling factor for irradiance input to SSAO + Persist + 0 + Type + F32 + Value + 0.6 + + RenderSSAOIrradianceMax + + Comment + Max factor for irradiance input to SSAO + Persist + 0 + Type + F32 + Value + 0.18 + RenderSSAOMaxScale Comment @@ -10566,40 +10588,29 @@ Type F32 Value - 1.25 - - RenderReflectionProbeMaxLocalLightAmbiance - - Comment - Maximum effective probe ambiance for local lights - Persist - 0 - Type - F32 - Value - 4.0 + 1.0 - RenderDynamicExposureMin + RenderSkyAutoAdjustLegacy Comment - Minimum dynamic exposure amount + If true, automatically adjust legacy skies (those without a probe ambiance value) to take advantage of probes and HDR. Persist - 0 + 1 Type - F32 + Boolean Value - 0.6 + 1 - RenderDynamicExposureMax + RenderReflectionProbeMaxLocalLightAmbiance Comment - Maximum dynamic exposure amount + Maximum effective probe ambiance for local lights Persist 0 Type F32 Value - 1.5 + 4.0 RenderDynamicExposureCoefficient diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 385cd51969..b752307d13 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -44,7 +44,7 @@ vec3 legacy_adjust_fullbright(vec3 c); vec3 legacy_adjust(vec3 c); vec3 linear_to_srgb(vec3 cl); vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten); -void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); +void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten); #ifdef HAS_ALPHA_MASK uniform float minimum_alpha; @@ -85,7 +85,7 @@ void main() vec3 amblit; vec3 additive; vec3 atten; - calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false); + calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten); #endif #ifdef WATER_FOG diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index a32296369c..53e4f02314 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -102,16 +102,12 @@ vec3 toneMap(vec3 color) { #ifndef NO_POST float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r; - + color *= exposure * exp_scale; color = toneMapACES_Hill(color); -#else - color *= 0.6; #endif - color = linear_to_srgb(color); - return color; } @@ -158,10 +154,10 @@ float noise(vec2 x) { vec3 legacyGamma(vec3 color) { - color = 1. - clamp(color, vec3(0.), vec3(1.)); - color = 1. - pow(color, vec3(gamma)); // s/b inverted already CPU-side + vec3 c = 1. - clamp(color, vec3(0.), vec3(1.)); + c = 1. - pow(c, vec3(gamma)); // s/b inverted already CPU-side - return color; + return c; } void main() @@ -169,12 +165,14 @@ void main() //this is the one of the rare spots where diffuseRect contains linear color values (not sRGB) vec4 diff = texture(diffuseRect, vary_fragcoord); - diff.rgb = toneMap(diff.rgb); - #ifdef LEGACY_GAMMA -#ifndef NO_POST + diff.rgb = linear_to_srgb(diff.rgb); diff.rgb = legacyGamma(diff.rgb); +#else +#ifndef NO_POST + diff.rgb = toneMap(diff.rgb); #endif + diff.rgb = linear_to_srgb(diff.rgb); #endif vec2 tc = vary_fragcoord.xy*screen_res*4.0; diff --git a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl index 7111a822c8..31b02377da 100644 --- a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl @@ -113,18 +113,31 @@ vec3 inv_toneMapACES_Hill(vec3 color) return color; } +// adjust legacy colors to back out tonemapping and exposure +// NOTE: obsolete now that setting probe ambiance to zero removes tonemapping and exposure, but keeping for a minute +// while that change goes through testing - davep 6/1/2023 +#define LEGACY_ADJUST 0 + vec3 legacy_adjust(vec3 c) { +#if LEGACY_ADJUST vec3 desat = rgb2hsv(c.rgb); desat.g *= 1.0-(1.0-desat.b)*0.5; desat.b += (1.0-desat.b)*0.1f; desat.rgb = hsv2rgb(desat); return desat; +#else + return c; +#endif } vec3 legacy_adjust_fullbright(vec3 c) { +#if LEGACY_ADJUST float exp_scale = clamp(texture(exposureMap, vec2(0.5, 0.5)).r, 0.01, 10.0); return c / exp_scale * 1.34; //magic 1.34 arrived at by binary search for a value that reproduces midpoint grey consistenty +#else + return c; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl new file mode 100644 index 0000000000..48cf234aa0 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl @@ -0,0 +1,54 @@ +/** + * @file class2\wl\atmosphericsF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +vec3 getAdditiveColor(); +vec3 getAtmosAttenuation(); +vec3 scaleSoftClipFrag(vec3 light); + +vec3 srgb_to_linear(vec3 col); +vec3 linear_to_srgb(vec3 col); + +uniform float sky_hdr_scale; + +vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten) +{ + light *= atten.r; + additive = srgb_to_linear(additive*2.0); + // magic 1.25 here is to match the default RenderSkyHDRScale -- this parameter needs to be plumbed into sky settings or something + // so it's available to all shaders that call atmosFragLighting instead of just softenLightF.glsl + additive *= sky_hdr_scale; + light += additive; + return light; +} + +vec3 atmosFragLightingLinear(vec3 light, vec3 additive, vec3 atten) +{ + return atmosFragLighting(light, additive, atten); +} + +vec3 atmosLighting(vec3 light) +{ + return atmosFragLighting(light, getAdditiveColor(), getAtmosAttenuation()); +} diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl new file mode 100644 index 0000000000..437fa0a6d5 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -0,0 +1,159 @@ +/** + * @file class2\windlight\atmosphericsFuncs.glsl + * + * $LicenseInfo:firstyear=2022&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2022, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform vec3 lightnorm; +uniform vec3 sunlight_color; +uniform vec3 moonlight_color; +uniform int sun_up_factor; +uniform vec3 ambient_color; +uniform vec3 blue_horizon; +uniform vec3 blue_density; +uniform float haze_horizon; +uniform float haze_density; +uniform float cloud_shadow; +uniform float density_multiplier; +uniform float distance_multiplier; +uniform float max_y; +uniform vec3 glow; +uniform float scene_light_strength; +uniform float sun_moon_glow_factor; +uniform float sky_hdr_scale; + +float getAmbientClamp() { return 1.0f; } + +vec3 srgb_to_linear(vec3 col); +vec3 legacy_adjust(vec3 col); + +// return colors in sRGB space +void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, + out vec3 atten) +{ + vec3 rel_pos = inPositionEye; + + //(TERRAIN) limit altitude + if (abs(rel_pos.y) > max_y) rel_pos *= (max_y / rel_pos.y); + + vec3 rel_pos_norm = normalize(rel_pos); + float rel_pos_len = length(rel_pos); + + vec3 sunlight = (sun_up_factor == 1) ? sunlight_color: moonlight_color; + + // sunlight attenuation effect (hue and brightness) due to atmosphere + // this is used later for sunlight modulation at various altitudes + vec3 light_atten = (blue_density + vec3(haze_density * 0.25)) * (density_multiplier * max_y); + // I had thought blue_density and haze_density should have equal weighting, + // but attenuation due to haze_density tends to seem too strong + + vec3 combined_haze = blue_density + vec3(haze_density); + vec3 blue_weight = blue_density / combined_haze; + vec3 haze_weight = vec3(haze_density) / combined_haze; + + //(TERRAIN) compute sunlight from lightnorm y component. Factor is roughly cosecant(sun elevation) (for short rays like terrain) + float above_horizon_factor = 1.0 / max(1e-6, lightnorm.y); + sunlight *= exp(-light_atten * above_horizon_factor); // for sun [horizon..overhead] this maps to an exp curve [0..1] + + // main atmospheric scattering line integral + float density_dist = rel_pos_len * density_multiplier; + + // Transparency (-> combined_haze) + // ATI Bugfix -- can't store combined_haze*density_dist*distance_multiplier in a variable because the ati + // compiler gets confused. + combined_haze = exp(-combined_haze * density_dist * distance_multiplier); + + // final atmosphere attenuation factor + atten = combined_haze.rgb; + + // compute haze glow + float haze_glow = dot(rel_pos_norm, lightnorm.xyz); + + // dampen sun additive contrib when not facing it... + // SL-13539: This "if" clause causes an "additive" white artifact at roughly 77 degreees. + // if (length(light_dir) > 0.01) + haze_glow *= max(0.0f, dot(light_dir, rel_pos_norm)); + + haze_glow = 1. - haze_glow; + // haze_glow is 0 at the sun and increases away from sun + haze_glow = max(haze_glow, .001); // set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) + haze_glow *= glow.x; + // higher glow.x gives dimmer glow (because next step is 1 / "angle") + haze_glow = pow(haze_glow, glow.z); + // glow.z should be negative, so we're doing a sort of (1 / "angle") function + + // add "minimum anti-solar illumination" + haze_glow += .25; + + haze_glow *= sun_moon_glow_factor; + + vec3 amb_color = ambient_color; + + // increase ambient when there are more clouds + vec3 tmpAmbient = amb_color + (vec3(1.) - amb_color) * cloud_shadow * 0.5; + + // Similar/Shared Algorithms: + // indra\llinventory\llsettingssky.cpp -- LLSettingsSky::calculateLightSettings() + // indra\newview\app_settings\shaders\class1\windlight\atmosphericsFuncs.glsl -- calcAtmosphericVars() + // haze color + vec3 cs = sunlight.rgb * (1. - cloud_shadow); + additive = (blue_horizon.rgb * blue_weight.rgb) * (cs + tmpAmbient.rgb) + (haze_horizon * haze_weight.rgb) * (cs * haze_glow + tmpAmbient.rgb); + + // brightness of surface both sunlight and ambient + + sunlit = sunlight.rgb; + amblit = tmpAmbient; + + additive *= vec3(1.0 - combined_haze); +} + +vec3 srgb_to_linear(vec3 col); + +// provide a touch of lighting in the opposite direction of the sun light + // so areas in shadow don't lose all detail +float ambientLighting(vec3 norm, vec3 light_dir) +{ + float ambient = min(abs(dot(norm.xyz, light_dir.xyz)), 1.0); + ambient *= 0.5; + ambient *= ambient; + ambient = (1.0 - ambient); + return ambient; +} + + +// return lit amblit in linear space, leave sunlit and additive in sRGB space +void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, out vec3 sunlit, out vec3 amblit, out vec3 additive, + out vec3 atten) +{ + calcAtmosphericVars(inPositionEye, light_dir, 1.0, sunlit, amblit, additive, atten); + + // 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; + + // 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)); + + amblit = srgb_to_linear(amblit); + amblit *= ambientLighting(norm, light_dir); +} diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl new file mode 100644 index 0000000000..800d08047a --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl @@ -0,0 +1,44 @@ +/** + * @file class2\wl\atmosphericsHelpersV.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// Output variables + +uniform float scene_light_strength; + +vec3 atmosFragAmbient(vec3 light, vec3 amblit) +{ + return amblit + light / 2.0; +} + +vec3 atmosFragAffectDirectionalLight(float lightIntensity, vec3 sunlit) +{ + return sunlit * lightIntensity; +} + +vec3 scaleDownLightFrag(vec3 light) +{ + return (light / scene_light_strength ); +} + diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl new file mode 100644 index 0000000000..6ecbfaecb1 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl @@ -0,0 +1,57 @@ +/** + * @file class2\wl\atmosphericsHelpersV.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + + +// Output variables +vec3 getSunlitColor(); +vec3 getAmblitColor(); +vec3 getAdditiveColor(); +vec3 getAtmosAttenuation(); +vec3 getPositionEye(); + +uniform float scene_light_strength; + +vec3 atmosAmbient() +{ + return getAmblitColor(); +} + +vec3 atmosAffectDirectionalLight(float lightIntensity) +{ + return getSunlitColor() * lightIntensity; +} + +vec3 atmosGetDiffuseSunlightColor() +{ + return getSunlitColor(); +} + +vec3 scaleDownLight(vec3 light) +{ + return (light / scene_light_strength ); +} + + diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsV.glsl new file mode 100644 index 0000000000..cc3617ba61 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsV.glsl @@ -0,0 +1,56 @@ +/** + * @file class2\wl\atmosphericsV.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// out param funcs + + +uniform vec3 sun_dir; +uniform vec3 moon_dir; +uniform int sun_up_factor; + +void setSunlitColor(vec3 v); +void setAmblitColor(vec3 v); +void setAdditiveColor(vec3 v); +void setAtmosAttenuation(vec3 v); +void setPositionEye(vec3 v); + +vec3 getAdditiveColor(); + +void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten); + +void calcAtmospherics(vec3 inPositionEye) { + vec3 P = inPositionEye; + setPositionEye(P); + vec3 tmpsunlit = vec3(1); + vec3 tmpamblit = vec3(1); + vec3 tmpaddlit = vec3(1); + vec3 tmpattenlit = vec3(1); + vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; + calcAtmosphericVars(inPositionEye, light_dir, 1, tmpsunlit, tmpamblit, tmpaddlit, tmpattenlit); + setSunlitColor(tmpsunlit); + setAmblitColor(tmpamblit); + setAdditiveColor(tmpaddlit); + setAtmosAttenuation(tmpattenlit); +} diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl new file mode 100644 index 0000000000..34669a6796 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl @@ -0,0 +1,48 @@ +/** + * @file class2\wl\atmosphericVarsF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +in vec3 vary_AdditiveColor; +in vec3 vary_AtmosAttenuation; + +vec3 getSunlitColor() +{ + return vec3(0,0,0); +} + +vec3 getAmblitColor() +{ + return vec3(0,0,0); +} + +vec3 getAdditiveColor() +{ + return vary_AdditiveColor; +} + +vec3 getAtmosAttenuation() +{ + return vec3(vary_AtmosAttenuation); +} diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl new file mode 100644 index 0000000000..1b854d80b3 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl @@ -0,0 +1,84 @@ +/** + * @file class2\wl\atmosphericVars.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +out vec3 vary_AdditiveColor; +out vec3 vary_AtmosAttenuation; + +vec3 additive_color; +vec3 atmos_attenuation; +vec3 sunlit_color; +vec3 amblit_color; +vec3 position_eye; + +vec3 getSunlitColor() +{ + return sunlit_color; +} +vec3 getAmblitColor() +{ + return amblit_color; +} + +vec3 getAdditiveColor() +{ + return additive_color; +} +vec3 getAtmosAttenuation() +{ + return atmos_attenuation; +} + +vec3 getPositionEye() +{ + return position_eye; +} + +void setPositionEye(vec3 v) +{ + position_eye = v; +} + +void setSunlitColor(vec3 v) +{ + sunlit_color = v; +} + +void setAmblitColor(vec3 v) +{ + amblit_color = v; +} + +void setAdditiveColor(vec3 v) +{ + additive_color = v; + vary_AdditiveColor = v; +} + +void setAtmosAttenuation(vec3 v) +{ + atmos_attenuation = v; + vary_AtmosAttenuation = v; +} diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl new file mode 100644 index 0000000000..7a6741fe0e --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterF.glsl @@ -0,0 +1,50 @@ +/** + * @file class2\wl\atmosphericVarsWaterF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +in vec3 vary_PositionEye; +in vec3 vary_AdditiveColor; +in vec3 vary_AtmosAttenuation; + +vec3 getSunlitColor() +{ + return vec3(0,0,0); +} +vec3 getAmblitColor() +{ + return vec3(0,0,0); +} +vec3 getAdditiveColor() +{ + return vary_AdditiveColor; +} +vec3 getAtmosAttenuation() +{ + return vary_AtmosAttenuation; +} +vec3 getPositionEye() +{ + return vary_PositionEye; +} + diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl new file mode 100644 index 0000000000..23c3aed4d8 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsWaterV.glsl @@ -0,0 +1,81 @@ +/** + * @file class2\wl\atmosphericVarsWaterV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +out vec3 vary_PositionEye; +out vec3 vary_AdditiveColor; +out vec3 vary_AtmosAttenuation; + +vec3 atmos_attenuation; +vec3 sunlit_color; +vec3 amblit_color; + +vec3 getSunlitColor() +{ + return sunlit_color; +} +vec3 getAmblitColor() +{ + return amblit_color; +} + +vec3 getAdditiveColor() +{ + return vary_AdditiveColor; +} +vec3 getAtmosAttenuation() +{ + return atmos_attenuation; +} + +vec3 getPositionEye() +{ + return vary_PositionEye; +} + +void setPositionEye(vec3 v) +{ + vary_PositionEye = v; +} + +void setSunlitColor(vec3 v) +{ + sunlit_color = v; +} + +void setAmblitColor(vec3 v) +{ + amblit_color = v; +} + +void setAdditiveColor(vec3 v) +{ + vary_AdditiveColor = v; +} + +void setAtmosAttenuation(vec3 v) +{ + atmos_attenuation = v; + vary_AtmosAttenuation = v; +} diff --git a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl new file mode 100644 index 0000000000..027bfb866f --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl @@ -0,0 +1,55 @@ +/** + * @file class2\wl\gammaF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + // DEPRECATED + +//soft clip effect has been moved to postDeferredGammaCorrect legacyGamma, this file is effectively dead +// but these functions need to be removed from all existing shaders before removing this file + +vec3 scaleSoftClipFrag(vec3 light) +{ + return light; +} + +vec3 scaleSoftClipFragLinear(vec3 light) +{ // identical to non-linear version and that's probably close enough + return light; +} + +vec3 scaleSoftClip(vec3 light) +{ + return light; +} + +vec3 fullbrightScaleSoftClipFrag(vec3 light, vec3 add, vec3 atten) +{ + return light; +} + +vec3 fullbrightScaleSoftClip(vec3 light) +{ + return light; +} + diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl deleted file mode 100644 index e314555ef9..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file class2\wl\atmosphericsF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -vec3 getAdditiveColor(); -vec3 getAtmosAttenuation(); -vec3 scaleSoftClipFrag(vec3 light); - -vec3 srgb_to_linear(vec3 col); -vec3 linear_to_srgb(vec3 col); - -uniform int sun_up_factor; - -vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten) -{ - light *= atten.r; - additive = srgb_to_linear(additive*2.0); - // magic 1.25 here is to match the default RenderSkyHDRScale -- this parameter needs to be plumbed into sky settings or something - // so it's available to all shaders that call atmosFragLighting instead of just softenLightF.glsl - additive *= sun_up_factor*1.25 + 1.0; - light += additive; - return light; -} - -vec3 atmosFragLightingLinear(vec3 light, vec3 additive, vec3 atten) -{ - return atmosFragLighting(light, additive, atten); -} - -vec3 atmosLighting(vec3 light) -{ - return atmosFragLighting(light, getAdditiveColor(), getAtmosAttenuation()); -} diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl deleted file mode 100644 index 4e0933f922..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @file class2\windlight\atmosphericsFuncs.glsl - * - * $LicenseInfo:firstyear=2022&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2022, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform vec3 lightnorm; -uniform vec3 sunlight_color; -uniform vec3 sunlight_linear; -uniform vec3 moonlight_color; -uniform vec3 moonlight_linear; -uniform int sun_up_factor; -uniform vec3 ambient_color; -uniform vec3 ambient_linear; -uniform vec3 blue_horizon; -uniform vec3 blue_horizon_linear; -uniform vec3 blue_density; -uniform vec3 blue_density_linear; -uniform float haze_horizon; -uniform float haze_density; -uniform float haze_density_linear; -uniform float cloud_shadow; -uniform float density_multiplier; -uniform float distance_multiplier; -uniform float max_y; -uniform vec3 glow; -uniform float scene_light_strength; -uniform mat3 ssao_effect_mat; -uniform float sun_moon_glow_factor; - -float getAmbientClamp() { return 1.0f; } - -vec3 srgb_to_linear(vec3 col); -vec3 legacy_adjust(vec3 col); - -// return colors in sRGB space -void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, - out vec3 atten, bool use_ao) -{ - vec3 rel_pos = inPositionEye; - - //(TERRAIN) limit altitude - if (abs(rel_pos.y) > max_y) rel_pos *= (max_y / rel_pos.y); - - vec3 rel_pos_norm = normalize(rel_pos); - float rel_pos_len = length(rel_pos); - - vec3 sunlight = (sun_up_factor == 1) ? sunlight_color: moonlight_color * 0.7; // magic 0.7 to match legacy color - - // sunlight attenuation effect (hue and brightness) due to atmosphere - // this is used later for sunlight modulation at various altitudes - vec3 light_atten = (blue_density + vec3(haze_density * 0.25)) * (density_multiplier * max_y); - // I had thought blue_density and haze_density should have equal weighting, - // but attenuation due to haze_density tends to seem too strong - - vec3 combined_haze = blue_density + vec3(haze_density); - vec3 blue_weight = blue_density / combined_haze; - vec3 haze_weight = vec3(haze_density) / combined_haze; - - //(TERRAIN) compute sunlight from lightnorm y component. Factor is roughly cosecant(sun elevation) (for short rays like terrain) - float above_horizon_factor = 1.0 / max(1e-6, lightnorm.y); - sunlight *= exp(-light_atten * above_horizon_factor); // for sun [horizon..overhead] this maps to an exp curve [0..1] - - // main atmospheric scattering line integral - float density_dist = rel_pos_len * density_multiplier; - - // Transparency (-> combined_haze) - // ATI Bugfix -- can't store combined_haze*density_dist*distance_multiplier in a variable because the ati - // compiler gets confused. - combined_haze = exp(-combined_haze * density_dist * distance_multiplier); - - // final atmosphere attenuation factor - atten = combined_haze.rgb; - - // compute haze glow - float haze_glow = dot(rel_pos_norm, lightnorm.xyz); - - // dampen sun additive contrib when not facing it... - // SL-13539: This "if" clause causes an "additive" white artifact at roughly 77 degreees. - // if (length(light_dir) > 0.01) - haze_glow *= max(0.0f, dot(light_dir, rel_pos_norm)); - - haze_glow = 1. - haze_glow; - // haze_glow is 0 at the sun and increases away from sun - haze_glow = max(haze_glow, .001); // set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) - haze_glow *= glow.x; - // higher glow.x gives dimmer glow (because next step is 1 / "angle") - haze_glow = pow(haze_glow, glow.z); - // glow.z should be negative, so we're doing a sort of (1 / "angle") function - - // add "minimum anti-solar illumination" - haze_glow += .25; - - haze_glow *= sun_moon_glow_factor; - - vec3 amb_color = ambient_color; - - // increase ambient when there are more clouds - vec3 tmpAmbient = amb_color + (vec3(1.) - amb_color) * cloud_shadow * 0.5; - - /* decrease value and saturation (that in HSV, not HSL) for occluded areas - * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html - * // The following line of code performs the equivalent of: - * float ambAlpha = tmpAmbient.a; - * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis - * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); - * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, - * ambAlpha); - */ - if (use_ao) - { - tmpAmbient = mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor); - } - - // Similar/Shared Algorithms: - // indra\llinventory\llsettingssky.cpp -- LLSettingsSky::calculateLightSettings() - // indra\newview\app_settings\shaders\class1\windlight\atmosphericsFuncs.glsl -- calcAtmosphericVars() - // haze color - vec3 cs = sunlight.rgb * (1. - cloud_shadow); - additive = (blue_horizon.rgb * blue_weight.rgb) * (cs + tmpAmbient.rgb) + (haze_horizon * haze_weight.rgb) * (cs * haze_glow + tmpAmbient.rgb); - - // brightness of surface both sunlight and ambient - - sunlit = sunlight.rgb; - amblit = vec3(1,0,1); //should no longer be used, filled in by calcAtmosphericVarsLinear - - additive *= vec3(1.0 - combined_haze); -} - -vec3 srgb_to_linear(vec3 col); - -// provide a touch of lighting in the opposite direction of the sun light - // so areas in shadow don't lose all detail -float ambientLighting(vec3 norm, vec3 light_dir) -{ - float ambient = min(abs(dot(norm.xyz, light_dir.xyz)), 1.0); - ambient *= 0.5; - ambient *= ambient; - ambient = (1.0 - ambient); - return ambient; -} - - -// return lit amblit in linear space, leave sunlit and additive in sRGB space -void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, out vec3 sunlit, out vec3 amblit, out vec3 additive, - out vec3 atten) -{ - calcAtmosphericVars(inPositionEye, light_dir, 1.0, sunlit, amblit, additive, atten, false); - - // multiply by 2 to get same colors as when the "scaleSoftClip" implementation was doubling color values - // (allows for mixing of light sources other than sunlight e.g. reflection probes) - sunlit *= 2.0; - - // squash ambient to approximate whatever weirdness legacy atmospherics were doing - amblit = ambient_color; // * (1.0+sun_up_factor*0.3); - - amblit *= ambientLighting(norm, light_dir); - amblit = srgb_to_linear(amblit); -} diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl deleted file mode 100644 index 800d08047a..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file class2\wl\atmosphericsHelpersV.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// Output variables - -uniform float scene_light_strength; - -vec3 atmosFragAmbient(vec3 light, vec3 amblit) -{ - return amblit + light / 2.0; -} - -vec3 atmosFragAffectDirectionalLight(float lightIntensity, vec3 sunlit) -{ - return sunlit * lightIntensity; -} - -vec3 scaleDownLightFrag(vec3 light) -{ - return (light / scene_light_strength ); -} - diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl deleted file mode 100644 index 6ecbfaecb1..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file class2\wl\atmosphericsHelpersV.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -// Output variables -vec3 getSunlitColor(); -vec3 getAmblitColor(); -vec3 getAdditiveColor(); -vec3 getAtmosAttenuation(); -vec3 getPositionEye(); - -uniform float scene_light_strength; - -vec3 atmosAmbient() -{ - return getAmblitColor(); -} - -vec3 atmosAffectDirectionalLight(float lightIntensity) -{ - return getSunlitColor() * lightIntensity; -} - -vec3 atmosGetDiffuseSunlightColor() -{ - return getSunlitColor(); -} - -vec3 scaleDownLight(vec3 light) -{ - return (light / scene_light_strength ); -} - - diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl deleted file mode 100644 index 3773f191e8..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file class2\wl\atmosphericsV.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// out param funcs - - -uniform vec3 sun_dir; -uniform vec3 moon_dir; -uniform int sun_up_factor; - -void setSunlitColor(vec3 v); -void setAmblitColor(vec3 v); -void setAdditiveColor(vec3 v); -void setAtmosAttenuation(vec3 v); -void setPositionEye(vec3 v); - -vec3 getAdditiveColor(); - -void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); - -void calcAtmospherics(vec3 inPositionEye) { - vec3 P = inPositionEye; - setPositionEye(P); - vec3 tmpsunlit = vec3(1); - vec3 tmpamblit = vec3(1); - vec3 tmpaddlit = vec3(1); - vec3 tmpattenlit = vec3(1); - vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; - calcAtmosphericVars(inPositionEye, light_dir, 1, tmpsunlit, tmpamblit, tmpaddlit, tmpattenlit, false); - setSunlitColor(tmpsunlit); - setAmblitColor(tmpamblit); - setAdditiveColor(tmpaddlit); - setAtmosAttenuation(tmpattenlit); -} diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl deleted file mode 100644 index 34669a6796..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file class2\wl\atmosphericVarsF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - -in vec3 vary_AdditiveColor; -in vec3 vary_AtmosAttenuation; - -vec3 getSunlitColor() -{ - return vec3(0,0,0); -} - -vec3 getAmblitColor() -{ - return vec3(0,0,0); -} - -vec3 getAdditiveColor() -{ - return vary_AdditiveColor; -} - -vec3 getAtmosAttenuation() -{ - return vec3(vary_AtmosAttenuation); -} diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl deleted file mode 100644 index 1b854d80b3..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file class2\wl\atmosphericVars.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - -out vec3 vary_AdditiveColor; -out vec3 vary_AtmosAttenuation; - -vec3 additive_color; -vec3 atmos_attenuation; -vec3 sunlit_color; -vec3 amblit_color; -vec3 position_eye; - -vec3 getSunlitColor() -{ - return sunlit_color; -} -vec3 getAmblitColor() -{ - return amblit_color; -} - -vec3 getAdditiveColor() -{ - return additive_color; -} -vec3 getAtmosAttenuation() -{ - return atmos_attenuation; -} - -vec3 getPositionEye() -{ - return position_eye; -} - -void setPositionEye(vec3 v) -{ - position_eye = v; -} - -void setSunlitColor(vec3 v) -{ - sunlit_color = v; -} - -void setAmblitColor(vec3 v) -{ - amblit_color = v; -} - -void setAdditiveColor(vec3 v) -{ - additive_color = v; - vary_AdditiveColor = v; -} - -void setAtmosAttenuation(vec3 v) -{ - atmos_attenuation = v; - vary_AtmosAttenuation = v; -} diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl deleted file mode 100644 index 7a6741fe0e..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file class2\wl\atmosphericVarsWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -in vec3 vary_PositionEye; -in vec3 vary_AdditiveColor; -in vec3 vary_AtmosAttenuation; - -vec3 getSunlitColor() -{ - return vec3(0,0,0); -} -vec3 getAmblitColor() -{ - return vec3(0,0,0); -} -vec3 getAdditiveColor() -{ - return vary_AdditiveColor; -} -vec3 getAtmosAttenuation() -{ - return vary_AtmosAttenuation; -} -vec3 getPositionEye() -{ - return vary_PositionEye; -} - diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl deleted file mode 100644 index 23c3aed4d8..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file class2\wl\atmosphericVarsWaterV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -out vec3 vary_PositionEye; -out vec3 vary_AdditiveColor; -out vec3 vary_AtmosAttenuation; - -vec3 atmos_attenuation; -vec3 sunlit_color; -vec3 amblit_color; - -vec3 getSunlitColor() -{ - return sunlit_color; -} -vec3 getAmblitColor() -{ - return amblit_color; -} - -vec3 getAdditiveColor() -{ - return vary_AdditiveColor; -} -vec3 getAtmosAttenuation() -{ - return atmos_attenuation; -} - -vec3 getPositionEye() -{ - return vary_PositionEye; -} - -void setPositionEye(vec3 v) -{ - vary_PositionEye = v; -} - -void setSunlitColor(vec3 v) -{ - sunlit_color = v; -} - -void setAmblitColor(vec3 v) -{ - amblit_color = v; -} - -void setAdditiveColor(vec3 v) -{ - vary_AdditiveColor = v; -} - -void setAtmosAttenuation(vec3 v) -{ - atmos_attenuation = v; - vary_AtmosAttenuation = v; -} diff --git a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl deleted file mode 100644 index 027bfb866f..0000000000 --- a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file class2\wl\gammaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - // DEPRECATED - -//soft clip effect has been moved to postDeferredGammaCorrect legacyGamma, this file is effectively dead -// but these functions need to be removed from all existing shaders before removing this file - -vec3 scaleSoftClipFrag(vec3 light) -{ - return light; -} - -vec3 scaleSoftClipFragLinear(vec3 light) -{ // identical to non-linear version and that's probably close enough - return light; -} - -vec3 scaleSoftClip(vec3 light) -{ - return light; -} - -vec3 fullbrightScaleSoftClipFrag(vec3 light, vec3 add, vec3 atten) -{ - return light; -} - -vec3 fullbrightScaleSoftClip(vec3 light) -{ - return light; -} - diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl index 1c79748b49..0d77e88831 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl @@ -42,7 +42,7 @@ uniform samplerCube environmentMap; vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten); vec3 legacy_adjust_fullbright(vec3 c); vec3 legacy_adjust(vec3 c); -void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); +void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten); vec3 linear_to_srgb(vec3 c); vec3 srgb_to_linear(vec3 c); @@ -71,7 +71,7 @@ void main() vec3 additive; vec3 atten; vec3 pos = vary_position; - calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false); + calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten); float env_intensity = vertex_color.a; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 3945e34d7a..53c5b1b801 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -44,9 +44,14 @@ uniform sampler2D lightFunc; uniform float blur_size; uniform float blur_fidelity; +#if defined(HAS_SSAO) +uniform float ssao_irradiance_scale; +uniform float ssao_irradiance_max; +#endif + // Inputs uniform mat3 env_mat; - +uniform mat3 ssao_effect_mat; uniform vec3 sun_dir; uniform vec3 moon_dir; uniform int sun_up_factor; @@ -112,6 +117,16 @@ vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor, vec3 l); //surface point to light +void adjustIrradiance(inout vec3 irradiance, vec3 amblit_linear, float ambocc) +{ + // use sky settings ambient or irradiance map sample, whichever is brighter + irradiance = max(amblit_linear, irradiance); + +#if defined(HAS_SSAO) + irradiance = mix(ssao_effect_mat * min(irradiance.rgb*ssao_irradiance_scale, vec3(ssao_irradiance_max)), irradiance.rgb, ambocc); +#endif +} + void main() { vec2 tc = vary_fragcoord.xy; @@ -173,7 +188,7 @@ void main() vec3 orm = texture(specularRect, tc).rgb; float perceptualRoughness = orm.g; float metallic = orm.b; - float ao = orm.r * ambocc; + float ao = orm.r; vec3 colorEmissive = texture(emissiveRect, tc).rgb; // PBR IBL @@ -181,9 +196,7 @@ void main() sampleReflectionProbes(irradiance, radiance, tc, pos.xyz, norm.xyz, gloss); - // Take maximium of legacy ambient vs irradiance sample as irradiance - // NOTE: ao is applied in pbrIbl (see pbrBaseLight), do not apply here - irradiance = max(amblit_linear,irradiance); + adjustIrradiance(irradiance, amblit_linear, ambocc); vec3 diffuseColor; vec3 specularColor; @@ -203,17 +216,15 @@ void main() //should only be true of WL sky, just port over base color value color = texture(emissiveRect, tc).rgb; color = srgb_to_linear(color); - if (sun_up_factor > 0) - { - color *= sky_hdr_scale + 1.0; - } + color *= sky_hdr_scale; } else { // legacy shaders are still writng sRGB to gbuffer baseColor.rgb = legacy_adjust(baseColor.rgb); - + baseColor.rgb = srgb_to_linear(baseColor.rgb); + spec.rgb = srgb_to_linear(spec.rgb); float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0); @@ -224,11 +235,10 @@ void main() sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, tc, pos.xyz, norm.xyz, spec.a, envIntensity); - // use sky settings ambient or irradiance map sample, whichever is brighter - irradiance = max(amblit_linear, irradiance); + adjustIrradiance(irradiance, amblit_linear, ambocc); // apply lambertian IBL only (see pbrIbl) - color.rgb = irradiance * ambocc; + color.rgb = irradiance; vec3 sun_contrib = min(da, scol) * sunlit_linear; color.rgb += sun_contrib; diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 6f09beea4a..ec2467200a 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 56 +version 57 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -275,7 +275,7 @@ RenderShadowDetail 1 2 RenderFSAASamples 1 2 RenderReflectionsEnabled 1 1 RenderReflectionProbeDetail 1 1 -RenderScreenSpaceReflections 1 1 +RenderScreenSpaceReflections 1 0 RenderReflectionProbeLevel 1 3 // diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index c4677de7bb..0687a3cea1 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 51 +version 52 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -273,7 +273,7 @@ RenderShadowDetail 1 2 RenderFSAASamples 1 2 RenderReflectionsEnabled 1 1 RenderReflectionProbeDetail 1 1 -RenderScreenSpaceReflections 1 1 +RenderScreenSpaceReflections 1 0 RenderReflectionProbeLevel 1 3 // diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 58da164b5a..d73a486877 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1748,19 +1748,8 @@ void LLEnvironment::updateGLVariablesForSettings(LLShaderUniforms* uniforms, con //_WARNS("RIDER") << "pushing '" << (*it).first << "' as " << value << LL_ENDL; break; case LLSD::TypeReal: - { - F32 v = value.asReal(); - switch (it.second.getShaderKey()) - { // convert to linear color space if this is a color parameter - case LLShaderMgr::HAZE_HORIZON: - case LLShaderMgr::HAZE_DENSITY: - case LLShaderMgr::CLOUD_SHADOW: - //v = sRGBtoLinear(v); - break; - } - shader->uniform1f(it.second.getShaderKey(), v); + shader->uniform1f(it.second.getShaderKey(), value.asReal()); //_WARNS("RIDER") << "pushing '" << (*it).first << "' as " << value << LL_ENDL; - } break; case LLSD::TypeBoolean: diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 4d11399867..f9e8963479 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -201,6 +201,8 @@ void LLFloaterEnvironmentAdjust::refresh() getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); + + updateGammaLabel(); } @@ -478,9 +480,25 @@ void LLFloaterEnvironmentAdjust::onReflectionProbeAmbianceChanged() if (!mLiveSky) return; F32 ambiance = getChild(FIELD_REFLECTION_PROBE_AMBIANCE)->getValue().asReal(); mLiveSky->setReflectionProbeAmbiance(ambiance); + + updateGammaLabel(); mLiveSky->update(); } +void LLFloaterEnvironmentAdjust::updateGammaLabel() +{ + if (!mLiveSky) return; + F32 ambiance = mLiveSky->getReflectionProbeAmbiance(); + if (ambiance != 0.f) + { + childSetValue("scene_gamma_label", getString("hdr_string")); + } + else + { + childSetValue("scene_gamma_label", getString("brightness_string")); + } +} + void LLFloaterEnvironmentAdjust::onEnvironmentUpdated(LLEnvironment::EnvSelection_t env, S32 version) { if (env == LLEnvironment::ENV_LOCAL) diff --git a/indra/newview/llfloaterenvironmentadjust.h b/indra/newview/llfloaterenvironmentadjust.h index 43c0ba0495..db893cca12 100644 --- a/indra/newview/llfloaterenvironmentadjust.h +++ b/indra/newview/llfloaterenvironmentadjust.h @@ -83,7 +83,7 @@ private: void onWaterMapChanged(); void onReflectionProbeAmbianceChanged(); - + void updateGammaLabel(); void onButtonReset(); void onEnvironmentUpdated(LLEnvironment::EnvSelection_t env, S32 version); diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index d17845ebc5..a14af27e59 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -213,6 +213,8 @@ void LLPanelSettingsSkyAtmosTab::refresh() getChild(FIELD_SKY_DENSITY_DROPLET_RADIUS)->setValue(droplet_radius); getChild(FIELD_SKY_DENSITY_ICE_LEVEL)->setValue(ice_level); getChild(FIELD_REFLECTION_PROBE_AMBIANCE)->setValue(rp_ambiance); + + updateGammaLabel(); } //------------------------------------------------------------------------- @@ -321,11 +323,29 @@ void LLPanelSettingsSkyAtmosTab::onReflectionProbeAmbianceChanged() { if (!mSkySettings) return; F32 ambiance = getChild(FIELD_REFLECTION_PROBE_AMBIANCE)->getValue().asReal(); + mSkySettings->setReflectionProbeAmbiance(ambiance); mSkySettings->update(); setIsDirty(); + + updateGammaLabel(); } + +void LLPanelSettingsSkyAtmosTab::updateGammaLabel() +{ + if (!mSkySettings) return; + F32 ambiance = mSkySettings->getReflectionProbeAmbiance(); + if (ambiance != 0.f) + { + childSetValue("scene_gamma_label", getString("hdr_string")); + } + else + { + childSetValue("scene_gamma_label", getString("brightness_string")); + } + +} //========================================================================== LLPanelSettingsSkyCloudTab::LLPanelSettingsSkyCloudTab() : LLPanelSettingsSky() diff --git a/indra/newview/llpaneleditsky.h b/indra/newview/llpaneleditsky.h index cd89e02eea..33af667ab7 100644 --- a/indra/newview/llpaneleditsky.h +++ b/indra/newview/llpaneleditsky.h @@ -80,6 +80,7 @@ private: void onDropletRadiusChanged(); void onIceLevelChanged(); void onReflectionProbeAmbianceChanged(); + void updateGammaLabel(); }; diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 5dc93dbeb8..15d41c4161 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -915,7 +915,8 @@ void LLReflectionMapManager::updateUniforms() LLSettingsSky::ptr_t psky = environment.getCurrentSky(); static LLCachedControl cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f); - F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance(cloud_shadow_scale); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance(cloud_shadow_scale, should_auto_adjust); F32 ambscale = gCubeSnapshot && !isRadiancePass() ? 0.f : 1.f; F32 radscale = gCubeSnapshot && !isRadiancePass() ? 0.5f : 1.f; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index de11f580a8..6321dbc085 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -718,45 +718,42 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) F32 g = getGamma(); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + + static LLCachedControl cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f); + F32 probe_ambiance = getTotalReflectionProbeAmbiance(cloud_shadow_scale); + if (irradiance_pass) { // during an irradiance map update, disable ambient lighting (direct lighting only) and desaturate sky color (avoid tinting the world blue) - shader->uniform3fv(LLShaderMgr::AMBIENT_LINEAR, LLVector3::zero.mV); shader->uniform3fv(LLShaderMgr::AMBIENT, LLVector3::zero.mV); } else { - if (psky->getReflectionProbeAmbiance() == 0.f) + if (psky->getReflectionProbeAmbiance() != 0.f) { - LLVector3 ambcol(ambient.mV); - F32 cloud_shadow = psky->getCloudShadow(); - LLVector3 tmpAmbient = ambcol + ((LLVector3::all_one - ambcol) * cloud_shadow * 0.5f); - - shader->uniform3fv(LLShaderMgr::AMBIENT_LINEAR, linearColor3v(tmpAmbient)); - shader->uniform3fv(LLShaderMgr::AMBIENT, tmpAmbient.mV); + shader->uniform3fv(LLShaderMgr::AMBIENT, getAmbientColor().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 * 0.5f).mV); + shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, 2.f); + probe_ambiance = 1.f; } else { - shader->uniform3fv(LLShaderMgr::AMBIENT_LINEAR, linearColor3v(getAmbientColor() / 3.f)); // note magic number 3.f comes from SLIDER_SCALE_SUN_AMBIENT + shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, 1.f); shader->uniform3fv(LLShaderMgr::AMBIENT, LLVector3(ambient.mV)); } } - shader->uniform3fv(LLShaderMgr::BLUE_HORIZON_LINEAR, linearColor3v(getBlueHorizon() / 2.f)); // note magic number of 2.f comes from SLIDER_SCALE_BLUE_HORIZON_DENSITY - shader->uniform3fv(LLShaderMgr::BLUE_DENSITY_LINEAR, linearColor3v(getBlueDensity() / 2.f)); - - shader->uniform3fv(LLShaderMgr::SUNLIGHT_LINEAR, linearColor3v(sunDiffuse)); - shader->uniform3fv(LLShaderMgr::MOONLIGHT_LINEAR,linearColor3v(moonDiffuse)); - - static LLCachedControl cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f); - shader->uniform1f(LLShaderMgr::REFLECTION_PROBE_AMBIANCE, getTotalReflectionProbeAmbiance(cloud_shadow_scale)); + shader->uniform1f(LLShaderMgr::REFLECTION_PROBE_AMBIANCE, probe_ambiance); shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, getIsSunUp() ? 1 : 0); shader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, getSunMoonGlowFactor()); shader->uniform1f(LLShaderMgr::DENSITY_MULTIPLIER, getDensityMultiplier()); shader->uniform1f(LLShaderMgr::DISTANCE_MULTIPLIER, getDistanceMultiplier()); - shader->uniform1f(LLShaderMgr::HAZE_DENSITY_LINEAR, sRGBtoLinear(getHazeDensity())); - shader->uniform1f(LLShaderMgr::GAMMA, g); } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d0dd02426e..02108e861a 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3014,7 +3014,7 @@ LLViewerMediaTexture* LLViewerMediaImpl::updateMediaImage() return nullptr; // not ready for updating } - llassert(!mTextureId.isNull()); + //llassert(!mTextureId.isNull()); // *TODO: Consider enabling mipmaps (they have been disabled for a long time). Likely has a significant performance impact for tiled/high texture repeat media. Mip generation in a shader may also be an option if necessary. LLViewerMediaTexture* media_tex = LLViewerTextureManager::getMediaTexture( mTextureId, USE_MIPMAPS ); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f178ec9d8d..cb58588848 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -489,20 +489,6 @@ bool LLViewerTexture::isMemoryForTextureLow() return (gpu < MIN_FREE_TEXTURE_MEMORY); // || (physical < MIN_FREE_MAIN_MEMORY); } -//static -bool LLViewerTexture::isMemoryForTextureSuficientlyFree() -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - const S32Megabytes DESIRED_FREE_TEXTURE_MEMORY(50); - const S32Megabytes DESIRED_FREE_MAIN_MEMORY(200); - - S32Megabytes gpu; - S32Megabytes physical; - getGPUMemoryForTextures(gpu, physical); - - return (gpu > DESIRED_FREE_TEXTURE_MEMORY); // && (physical > DESIRED_FREE_MAIN_MEMORY); -} - //static void LLViewerTexture::getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical) { diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 34118c86cd..35fb0a2237 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -186,7 +186,6 @@ private: virtual void switchToCachedImage(); - static bool isMemoryForTextureSuficientlyFree(); static void getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical); public: diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9a8597e519..852845edf4 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6751,22 +6751,25 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst) { static LLStaticHashedString noiseVec("noiseVec"); static LLStaticHashedString dynamic_exposure_params("dynamic_exposure_params"); static LLCachedControl dynamic_exposure_coefficient(gSavedSettings, "RenderDynamicExposureCoefficient", 0.175f); - static LLCachedControl dynamic_exposure_min(gSavedSettings, "RenderDynamicExposureMin", 0.125f); - static LLCachedControl dynamic_exposure_max(gSavedSettings, "RenderDynamicExposureMax", 1.3f); - - F32 exposure_max = dynamic_exposure_max; LLSettingsSky::ptr_t sky = LLEnvironment::instance().getCurrentSky(); - if (sky->getReflectionProbeAmbiance() > 0.f) - { //not a legacy sky, use gamma as a boost to max exposure - exposure_max = llmax(exposure_max - 1.f, 0.f); - exposure_max *= sky->getGamma(); - exposure_max += 1.f; - } + F32 probe_ambiance = LLEnvironment::instance().getCurrentSky()->getReflectionProbeAmbiance(); + F32 exp_min = 1.f; + F32 exp_max = 1.f; + + if (probe_ambiance > 0.f) + { + F32 hdr_scale = sqrtf(LLEnvironment::instance().getCurrentSky()->getGamma())*2.f; + if (hdr_scale > 1.f) + { + exp_min = 1.f / hdr_scale; + exp_max = hdr_scale; + } + } gExposureProgram.uniform1f(dt, gFrameIntervalSeconds); gExposureProgram.uniform2f(noiseVec, ll_frand() * 2.0 - 1.0, ll_frand() * 2.0 - 1.0); - gExposureProgram.uniform3f(dynamic_exposure_params, dynamic_exposure_coefficient, dynamic_exposure_min, exposure_max); + gExposureProgram.uniform3f(dynamic_exposure_params, dynamic_exposure_coefficient, exp_min, exp_max); mScreenTriangleVB->setBuffer(); mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3); @@ -6789,8 +6792,12 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) { // Apply gamma correction to the frame here. + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + + LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); + LLGLSLShader& shader = no_post && gFloaterTools->isAvailable() ? gNoPostGammaCorrectProgram : // no post (no gamma, no exposure, no tonemapping) - LLEnvironment::instance().getCurrentSky()->getReflectionProbeAmbiance() == 0.f ? gLegacyPostGammaCorrectProgram : + psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f ? gLegacyPostGammaCorrectProgram : gDeferredPostGammaCorrectProgram; shader.bind(); @@ -7846,14 +7853,18 @@ void LLPipeline::renderDeferredLighting() LL_PROFILE_GPU_ZONE("atmospherics"); bindDeferredShader(soften_shader); - static LLCachedControl sky_scale(gSavedSettings, "RenderSkyHDRScale", 1.f); - static LLStaticHashedString sky_hdr_scale("sky_hdr_scale"); + static LLCachedControl ssao_scale(gSavedSettings, "RenderSSAOIrradianceScale", 0.5f); + static LLCachedControl ssao_max(gSavedSettings, "RenderSSAOIrradianceMax", 0.25f); + static LLStaticHashedString ssao_scale_str("ssao_irradiance_scale"); + static LLStaticHashedString ssao_max_str("ssao_irradiance_max"); + + soften_shader.uniform1f(ssao_scale_str, ssao_scale); + soften_shader.uniform1f(ssao_max_str, ssao_max); LLEnvironment &environment = LLEnvironment::instance(); soften_shader.uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0); soften_shader.uniform3fv(LLShaderMgr::LIGHTNORM, 1, environment.getClampedLightNorm().mV); - soften_shader.uniform1f(sky_hdr_scale, sky_scale); - + soften_shader.uniform4fv(LLShaderMgr::WATER_WATERPLANE, 1, LLDrawPoolAlpha::sWaterPlane.mV); { diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml index 5258bdbaf2..518a83f846 100644 --- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml +++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml @@ -10,6 +10,8 @@ min_height="275" single_instance="true" can_resize="false"> + HDR Scale: + Brightness: - Brightness: - + Brightness: + + + + + + HDR Scale: + Brightness: - - Brightness: - - - Reflection Probe Ambiance: + Reflection Probe Ambiance (HDR): + + Brightness: + + -- cgit v1.2.3