Merge branch 'DRTVWR-559' of https://github.com/secondlife/viewer
# Conflicts: # indra/newview/app_settings/settings.xml # indra/newview/llviewermedia.cpp # indra/newview/llviewertexture.h # indra/newview/skins/default/xui/en/floater_adjust_environment.xml # indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xmlmaster
commit
a466a2b136
|
|
@ -693,6 +693,7 @@ void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf)
|
|||
F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in)
|
||||
{
|
||||
LLSettingsBase::TrackPosition blendf = blendf_in;
|
||||
llassert(!isnan(blendf));
|
||||
if (blendf >= 1.0)
|
||||
{
|
||||
triggerComplete();
|
||||
|
|
|
|||
|
|
@ -467,6 +467,7 @@ protected:
|
|||
|
||||
class LLSettingsBlenderTimeDelta : public LLSettingsBlender
|
||||
{
|
||||
protected:
|
||||
LOG_CLASS(LLSettingsBlenderTimeDelta);
|
||||
public:
|
||||
static const LLSettingsBase::BlendFactor MIN_BLEND_DELTA;
|
||||
|
|
|
|||
|
|
@ -407,6 +407,7 @@ LLSettingsSky::LLSettingsSky(const LLSD &data) :
|
|||
mNextRainbowTextureId(),
|
||||
mNextHaloTextureId()
|
||||
{
|
||||
mCanAutoAdjust = !data.has(SETTING_REFLECTION_PROBE_AMBIANCE);
|
||||
}
|
||||
|
||||
LLSettingsSky::LLSettingsSky():
|
||||
|
|
@ -429,6 +430,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)
|
||||
|
|
@ -441,6 +444,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)
|
||||
|
|
@ -1433,18 +1437,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<std::string, S32> mapNameToUniformId_t;
|
||||
|
||||
static mapNameToUniformId_t sNameToUniformMapping;
|
||||
|
|
|
|||
|
|
@ -1272,13 +1272,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");
|
||||
|
|
@ -1479,9 +1477,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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -299,9 +297,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
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
<string>RenderDeferredSSAO</string>
|
||||
<string>RenderDepthOfField</string>
|
||||
<string>RenderDepthOfFieldInEditMode</string>
|
||||
<string>RenderDynamicExposureCoefficient</string>
|
||||
<string>RenderExposure</string>
|
||||
<string>RenderFarClip</string>
|
||||
<string>RenderFlexTimeFactor</string>
|
||||
|
|
@ -40,6 +41,11 @@
|
|||
<string>RenderShaderLightingMaxLevel</string>
|
||||
<string>RenderShadowDetail</string>
|
||||
<string>RenderShadowResolutionScale</string>
|
||||
<string>RenderSkyAutoAdjustLegacy</string>
|
||||
<string>RenderSkyHDRScale</string>
|
||||
<string>RenderSSAOIrradianceScale</string>
|
||||
<string>RenderSSAOIrradianceMax</string>
|
||||
<string>RenderSunDynamicRange</string>
|
||||
<string>RenderTerrainDetail</string>
|
||||
<string>RenderTerrainLODFactor</string>
|
||||
<string>RenderTerrainScale</string>
|
||||
|
|
|
|||
|
|
@ -12030,6 +12030,28 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Backup</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>RenderSSAOIrradianceScale</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Scaling factor for irradiance input to SSAO</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.6</real>
|
||||
</map>
|
||||
<key>RenderSSAOIrradianceMax</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Max factor for irradiance input to SSAO</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.18</real>
|
||||
</map>
|
||||
<key>RenderSSAOMaxScale</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -13644,7 +13666,18 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>1.25</real>
|
||||
<real>1.0</real>
|
||||
</map>
|
||||
<key>RenderSkyAutoAdjustLegacy</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>If true, automatically adjust legacy skies (those without a probe ambiance value) to take advantage of probes and HDR.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>RenderReflectionProbeMaxLocalLightAmbiance</key>
|
||||
<map>
|
||||
|
|
@ -13657,28 +13690,6 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<real>4.0</real>
|
||||
</map>
|
||||
<key>RenderDynamicExposureMin</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Minimum dynamic exposure amount</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.6</real>
|
||||
</map>
|
||||
<key>RenderDynamicExposureMax</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum dynamic exposure amount</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>1.5</real>
|
||||
</map>
|
||||
<key>RenderDynamicExposureCoefficient</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ vec3 pbrIbl(vec3 diffuseColor,
|
|||
{
|
||||
// retrieve a scale and bias to F0. See [1], Figure 3
|
||||
vec2 brdf = BRDF(clamp(nv, 0, 1), 1.0-perceptualRough);
|
||||
vec3 diffuseLight = irradiance*1.25; //magic 1.25 to balance with legacy materials
|
||||
vec3 diffuseLight = irradiance;
|
||||
vec3 specularLight = radiance;
|
||||
|
||||
vec3 diffuse = diffuseLight * diffuseColor;
|
||||
|
|
@ -563,7 +563,7 @@ vec3 pbrBaseLight(vec3 diffuseColor, vec3 specularColor, float metallic, vec3 v,
|
|||
vec3 ibl_spec;
|
||||
color += pbrIbl(diffuseColor, specularColor, radiance, irradiance, ao, NdotV, perceptualRoughness, ibl_spec);
|
||||
|
||||
color += pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, norm, v, normalize(light_dir), specContrib) * sunlit * 3.9 * scol; //magic number to balance with legacy materials
|
||||
color += pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, norm, v, normalize(light_dir), specContrib) * sunlit * 3.0 * scol; //magic number to balance with legacy materials
|
||||
specContrib *= sunlit * 2.75 * scol;
|
||||
specContrib += ibl_spec;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ vec3 scaleSoftClipFrag(vec3 light);
|
|||
vec3 srgb_to_linear(vec3 col);
|
||||
vec3 linear_to_srgb(vec3 col);
|
||||
|
||||
uniform int sun_up_factor;
|
||||
uniform float sky_hdr_scale;
|
||||
|
||||
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
|
||||
{
|
||||
|
|
@ -38,7 +38,7 @@ vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
|
|||
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;
|
||||
additive *= sky_hdr_scale;
|
||||
light += additive;
|
||||
return light;
|
||||
}
|
||||
|
|
@ -25,27 +25,21 @@
|
|||
|
||||
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;
|
||||
uniform float sky_hdr_scale;
|
||||
|
||||
float getAmbientClamp() { return 1.0f; }
|
||||
|
||||
|
|
@ -54,7 +48,7 @@ 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)
|
||||
out vec3 atten)
|
||||
{
|
||||
vec3 rel_pos = inPositionEye;
|
||||
|
||||
|
|
@ -64,7 +58,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
|
|||
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
|
||||
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
|
||||
|
|
@ -117,20 +111,6 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
|
|||
// 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()
|
||||
|
|
@ -141,7 +121,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
|
|||
// brightness of surface both sunlight and ambient
|
||||
|
||||
sunlit = sunlight.rgb;
|
||||
amblit = vec3(1,0,1); //should no longer be used, filled in by calcAtmosphericVarsLinear
|
||||
amblit = tmpAmbient;
|
||||
|
||||
additive *= vec3(1.0 - combined_haze);
|
||||
}
|
||||
|
|
@ -164,15 +144,16 @@ float ambientLighting(vec3 norm, vec3 light_dir)
|
|||
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);
|
||||
calcAtmosphericVars(inPositionEye, light_dir, 1.0, sunlit, amblit, additive, atten);
|
||||
|
||||
// multiply by 2 to get same colors as when the "scaleSoftClip" implementation was doubling color values
|
||||
// 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 *= 2.0;
|
||||
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));
|
||||
|
||||
// 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);
|
||||
amblit *= ambientLighting(norm, light_dir);
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ 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 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;
|
||||
|
|
@ -48,7 +48,7 @@ void calcAtmospherics(vec3 inPositionEye) {
|
|||
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);
|
||||
calcAtmosphericVars(inPositionEye, light_dir, 1, tmpsunlit, tmpamblit, tmpaddlit, tmpattenlit);
|
||||
setSunlitColor(tmpsunlit);
|
||||
setAmblitColor(tmpamblit);
|
||||
setAdditiveColor(tmpaddlit);
|
||||
|
|
@ -152,7 +152,7 @@ vec3 calcPointLightOrSpotLight(vec3 diffuseColor, vec3 specularColor,
|
|||
// spot*spot => GL_SPOT_EXPONENT=2
|
||||
float spot_atten = spot*spot;
|
||||
|
||||
vec3 intensity = spot_atten * dist_atten * lightColor * 3.9; //magic number to balance with legacy materials
|
||||
vec3 intensity = spot_atten * dist_atten * lightColor * 3.0; //magic number to balance with legacy materials
|
||||
|
||||
vec3 speccol;
|
||||
color = intensity*pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, n.xyz, v, lv, speccol);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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,16 +196,13 @@ 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;
|
||||
calcDiffuseSpecular(baseColor.rgb, metallic, diffuseColor, specularColor);
|
||||
|
||||
vec3 v = -normalize(pos.xyz);
|
||||
color = vec3(1,0,1);
|
||||
color = pbrBaseLight(diffuseColor, specularColor, metallic, v, norm.xyz, perceptualRoughness, light_dir, sunlit_linear, scol, radiance, irradiance, colorEmissive, ao, additive, atten);
|
||||
|
||||
if (do_atmospherics)
|
||||
|
|
@ -203,17 +215,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 +234,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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
version 43
|
||||
version 44
|
||||
// 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
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -175,6 +175,9 @@ namespace
|
|||
// Find normalized track position of given time along full length of cycle
|
||||
inline LLSettingsBase::TrackPosition convert_time_to_position(const LLSettingsBase::Seconds& time, const LLSettingsBase::Seconds& len)
|
||||
{
|
||||
// early out to avoid divide by zero. if len is zero then jump to end position
|
||||
if (len == 0.f) return 1.f;
|
||||
|
||||
LLSettingsBase::TrackPosition position = LLSettingsBase::TrackPosition(fmod((F64)time, (F64)len) / (F64)len);
|
||||
return llclamp(position, 0.0f, 1.0f);
|
||||
}
|
||||
|
|
@ -1869,19 +1872,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:
|
||||
|
|
|
|||
|
|
@ -201,6 +201,8 @@ void LLFloaterEnvironmentAdjust::refresh()
|
|||
getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth);
|
||||
getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->setValue(elevation);
|
||||
getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->setRotation(quat);
|
||||
|
||||
updateGammaLabel();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -478,9 +480,25 @@ void LLFloaterEnvironmentAdjust::onReflectionProbeAmbianceChanged()
|
|||
if (!mLiveSky) return;
|
||||
F32 ambiance = getChild<LLUICtrl>(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)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ private:
|
|||
void onWaterMapChanged();
|
||||
|
||||
void onReflectionProbeAmbianceChanged();
|
||||
|
||||
void updateGammaLabel();
|
||||
void onButtonReset();
|
||||
|
||||
void onEnvironmentUpdated(LLEnvironment::EnvSelection_t env, S32 version);
|
||||
|
|
|
|||
|
|
@ -213,6 +213,8 @@ void LLPanelSettingsSkyAtmosTab::refresh()
|
|||
getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->setValue(droplet_radius);
|
||||
getChild<LLUICtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->setValue(ice_level);
|
||||
getChild<LLUICtrl>(FIELD_REFLECTION_PROBE_AMBIANCE)->setValue(rp_ambiance);
|
||||
|
||||
updateGammaLabel();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
@ -321,11 +323,29 @@ void LLPanelSettingsSkyAtmosTab::onReflectionProbeAmbianceChanged()
|
|||
{
|
||||
if (!mSkySettings) return;
|
||||
F32 ambiance = getChild<LLUICtrl>(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()
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ private:
|
|||
void onDropletRadiusChanged();
|
||||
void onIceLevelChanged();
|
||||
void onReflectionProbeAmbianceChanged();
|
||||
void updateGammaLabel();
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -915,7 +915,8 @@ void LLReflectionMapManager::updateUniforms()
|
|||
LLSettingsSky::ptr_t psky = environment.getCurrentSky();
|
||||
|
||||
static LLCachedControl<F32> cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f);
|
||||
F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance(cloud_shadow_scale);
|
||||
static LLCachedControl<bool> 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;
|
||||
|
|
|
|||
|
|
@ -718,45 +718,42 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
|
|||
|
||||
F32 g = getGamma();
|
||||
|
||||
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
|
||||
|
||||
static LLCachedControl<F32> 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<F32> 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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3075,7 +3075,7 @@ LLViewerMediaTexture* LLViewerMediaImpl::updateMediaImage()
|
|||
return nullptr; // not ready for updating
|
||||
}
|
||||
|
||||
llassert(!mTextureId.isNull());
|
||||
//llassert(!mTextureId.isNull());
|
||||
// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0)
|
||||
if (LLViewerFetchedTexture::sDefaultDiffuseImagep.notNull() && LLViewerFetchedTexture::sDefaultDiffuseImagep->getID() == mTextureId)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -518,20 +518,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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -194,7 +194,6 @@ private:
|
|||
|
||||
virtual void switchToCachedImage();
|
||||
|
||||
static bool isMemoryForTextureSuficientlyFree();
|
||||
public: // <FS:Ansariel> Dynamic texture memory calculation
|
||||
static void getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical);
|
||||
|
||||
|
|
|
|||
|
|
@ -6899,22 +6899,25 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst) {
|
|||
static LLStaticHashedString noiseVec("noiseVec");
|
||||
static LLStaticHashedString dynamic_exposure_params("dynamic_exposure_params");
|
||||
static LLCachedControl<F32> dynamic_exposure_coefficient(gSavedSettings, "RenderDynamicExposureCoefficient", 0.175f);
|
||||
static LLCachedControl<F32> dynamic_exposure_min(gSavedSettings, "RenderDynamicExposureMin", 0.125f);
|
||||
static LLCachedControl<F32> 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);
|
||||
|
|
@ -6937,8 +6940,12 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) {
|
|||
|
||||
// Apply gamma correction to the frame here.
|
||||
|
||||
static LLCachedControl<bool> 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();
|
||||
|
|
@ -8007,14 +8014,18 @@ void LLPipeline::renderDeferredLighting()
|
|||
LL_PROFILE_GPU_ZONE("atmospherics");
|
||||
bindDeferredShader(soften_shader);
|
||||
|
||||
static LLCachedControl<F32> sky_scale(gSavedSettings, "RenderSkyHDRScale", 1.f);
|
||||
static LLStaticHashedString sky_hdr_scale("sky_hdr_scale");
|
||||
static LLCachedControl<F32> ssao_scale(gSavedSettings, "RenderSSAOIrradianceScale", 0.5f);
|
||||
static LLCachedControl<F32> 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);
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<floater name="env_adjust_snapshot" title="Persönliche Beleuchtung">
|
||||
<string name="hdr_string">
|
||||
HDR-Skalierung:
|
||||
</string>
|
||||
<string name="brightness_string">
|
||||
Helligkeit:
|
||||
</string>
|
||||
<layout_stack name="outer_stack">
|
||||
<layout_panel name="env_controls">
|
||||
<layout_stack name="settings_stack">
|
||||
|
|
@ -40,12 +46,12 @@
|
|||
<text name="cloud_scale_label">
|
||||
Wolken-Skalierung:
|
||||
</text>
|
||||
<text name="bightness_label">
|
||||
Helligkeit:
|
||||
</text>
|
||||
<text name="reflection_probe_ambiance_label">
|
||||
Reflexionstest Umgebung:
|
||||
</text>
|
||||
<text name="scene_gamma_label">
|
||||
Helligkeit:
|
||||
</text>
|
||||
</layout_panel>
|
||||
<layout_panel name="lp_3">
|
||||
<text name="label">
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
<check_box label="Ambient Occlusion" name="UseSSAO"/>
|
||||
<check_box label="Reflexionen" name="ReflectionsEnabled"/>
|
||||
<check_box label="Screen Space Reflections" name="ScreenSpaceReflections"/>
|
||||
<check_box label="Auto-Anpassung hist. Himmel" name="AutoAdjustLegacySky"/>
|
||||
<text name="shadows_label">
|
||||
Schatten:
|
||||
</text>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<panel label="Atmosphäre & Beleuchtung" name="panel_settings_sky_atmos">
|
||||
<string name="hdr_string">
|
||||
HDR-Skalierung:
|
||||
</string>
|
||||
<string name="brightness_string">
|
||||
Helligkeit:
|
||||
</string>
|
||||
<layout_stack name="main_ls">
|
||||
<layout_panel name="top_lp">
|
||||
<text name="ambient_color_label">
|
||||
|
|
@ -44,14 +50,14 @@
|
|||
Maximale Höhe:
|
||||
</text>
|
||||
<slider name="max_alt" width="199"/>
|
||||
<text name="brightness_label" width="120">
|
||||
<text name="probe_ambiance_label" tool_tip="Strahlungsintensität. Aktiviert HDR-Beleuchtungsmodell, falls nicht 0." width="120">
|
||||
Umgebung Reflexionstest (HDR):
|
||||
</text>
|
||||
<slider name="probe_ambiance" width="187"/>
|
||||
<text name="scene_gamma_label" width="120">
|
||||
Helligkeit:
|
||||
</text>
|
||||
<slider name="scene_gamma" width="187"/>
|
||||
<text name="probe_ambiance_label" width="120">
|
||||
Umgebung Reflexionstest:
|
||||
</text>
|
||||
<slider name="probe_ambiance" width="187"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
min_height="275"
|
||||
single_instance="true"
|
||||
can_resize="false">
|
||||
<string name="hdr_string">HDR Scale:</string>
|
||||
<string name="brightness_string">Brightness:</string>
|
||||
<layout_stack name="outer_stack"
|
||||
width="845"
|
||||
height="275"
|
||||
|
|
@ -245,31 +247,12 @@
|
|||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
name="bightness_label"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="15"
|
||||
width="185">Brightness:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
max_val="20"
|
||||
name="scene_gamma"
|
||||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
name="reflection_probe_ambiance_label"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="15"
|
||||
top_pad="5"
|
||||
width="180">Reflection Probe Ambiance:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
|
|
@ -284,6 +267,25 @@
|
|||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
<text follows="left|top"
|
||||
name="scene_gamma_label"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="-5"
|
||||
top_pad="5"
|
||||
width="185">Brightness:</text>
|
||||
<slider decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
max_val="20"
|
||||
name="scene_gamma"
|
||||
top_pad="5"
|
||||
width="185"
|
||||
can_edit_text="true"/>
|
||||
</layout_panel>
|
||||
<layout_panel border="false"
|
||||
name="lp_3"
|
||||
|
|
|
|||
|
|
@ -600,6 +600,20 @@
|
|||
function="Pref.RenderOptionUpdate" />
|
||||
</check_box>
|
||||
|
||||
<check_box
|
||||
control_name="RenderSkyAutoAdjustLegacy"
|
||||
height="16"
|
||||
initial_value="true"
|
||||
label="Auto-adjust Legacy Sky"
|
||||
layout="topleft"
|
||||
left="420"
|
||||
name="AutoAdjustLegacySky"
|
||||
top_delta="16"
|
||||
width="240">
|
||||
<check_box.commit_callback
|
||||
function="Pref.RenderOptionUpdate" />
|
||||
</check_box>
|
||||
|
||||
<check_box
|
||||
control_name="RenderDepthOfField"
|
||||
height="16"
|
||||
|
|
|
|||
|
|
@ -306,6 +306,19 @@
|
|||
<check_box.commit_callback
|
||||
function="Pref.RenderOptionUpdate" />
|
||||
</check_box>
|
||||
<check_box
|
||||
control_name="RenderSkyAutoAdjustLegacy"
|
||||
height="16"
|
||||
initial_value="true"
|
||||
label="Auto-adjust Legacy Sky"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
name="AutoAdjustLegacySky"
|
||||
top_pad="1"
|
||||
width="256">
|
||||
<check_box.commit_callback
|
||||
function="Pref.RenderOptionUpdate" />
|
||||
</check_box>
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
left="0"
|
||||
name="panel_settings_sky_atmos"
|
||||
top="0">
|
||||
<string name="hdr_string">HDR Scale:</string>
|
||||
<string name="brightness_string">Brightness:</string>
|
||||
<layout_stack
|
||||
name="main_ls"
|
||||
follows="all"
|
||||
|
|
@ -309,8 +311,34 @@
|
|||
top_delta="0"
|
||||
width="219"
|
||||
can_edit_text="true"/>
|
||||
<text
|
||||
name="brightness_label"
|
||||
<text
|
||||
name="probe_ambiance_label"
|
||||
follows="left|top"
|
||||
height="40"
|
||||
layout="topleft"
|
||||
left="5"
|
||||
top_pad="12"
|
||||
width="105"
|
||||
tooltip="Irradiance control. When not zero, enables HDR lighting model."
|
||||
wrap="true">
|
||||
Reflection Probe Ambiance (HDR):
|
||||
</text>
|
||||
<slider
|
||||
decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
min_val="0"
|
||||
max_val="10"
|
||||
name="probe_ambiance"
|
||||
top_delta="3"
|
||||
width="219"
|
||||
can_edit_text="true"/>
|
||||
<text
|
||||
name="scene_gamma_label"
|
||||
follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
|
|
@ -332,31 +360,6 @@
|
|||
top_delta="0"
|
||||
width="219"
|
||||
can_edit_text="true"/>
|
||||
<text
|
||||
name="probe_ambiance_label"
|
||||
follows="left|top"
|
||||
height="40"
|
||||
layout="topleft"
|
||||
left="5"
|
||||
top_pad="12"
|
||||
width="105"
|
||||
wrap="true">
|
||||
Reflection Probe Ambiance:
|
||||
</text>
|
||||
<slider
|
||||
decimal_digits="2"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
increment="0.01"
|
||||
initial_value="0"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
min_val="0"
|
||||
max_val="10"
|
||||
name="probe_ambiance"
|
||||
top_delta="3"
|
||||
width="219"
|
||||
can_edit_text="true"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
Loading…
Reference in New Issue