diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index e6c649076f46720a31e73aebbdf9670590e74a11..6ce141ad373fed8075787b2b4ea75914c23242d1 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -630,7 +630,7 @@ const LLSettingsSky::validation_list_t& LLSettingsSky::validationList() boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); validation.push_back(Validator(SETTING_REFLECTION_PROBE_AMBIANCE, false, LLSD::TypeReal, - boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(10.0f))))); validation.push_back(Validator(SETTING_RAYLEIGH_CONFIG, true, LLSD::TypeArray, &validateRayleighLayers)); validation.push_back(Validator(SETTING_ABSORPTION_CONFIG, true, LLSD::TypeArray, &validateAbsorptionLayers)); diff --git a/indra/newview/app_settings/shaders/class1/alchemy/toneMapF.glsl b/indra/newview/app_settings/shaders/class1/alchemy/toneMapF.glsl index 87b7f035c9fa7b59d3e3372d9d787cb4dbc6bb0e..3b3368ded65bac646f38ccc7ab5996145b6e6dc0 100644 --- a/indra/newview/app_settings/shaders/class1/alchemy/toneMapF.glsl +++ b/indra/newview/app_settings/shaders/class1/alchemy/toneMapF.glsl @@ -292,12 +292,21 @@ vec3 legacyGamma(vec3 color) return color; } +float legacyGammaApprox() +{ + //TODO -- figure out how to plumb this in as a uniform + float c = 0.5; + float gc = 1.0-pow(c, gamma); + + return gc/c * gamma; +} + void main() { vec4 diff = texture(diffuseRect, vary_fragcoord); float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r; - diff.rgb *= exposure * exp_scale; + diff.rgb *= exposure * exp_scale * legacyGammaApprox(); #if TONEMAP_METHOD == 0 // None, Gamma Correct Only #define NEEDS_GAMMA_CORRECT 1 @@ -356,8 +365,6 @@ void main() diff = vec4(textureLod(colorgrade_lut, scale * diff.rgb + offset, 0).rgb, diff.a); #endif - diff.rgb = legacyGamma(diff.rgb); - vec2 tc = vary_fragcoord.xy*screen_res*4.0; vec3 seed = (diff.rgb+vec3(1.0))*vec3(tc.xy, tc.x+tc.y); vec3 nz = vec3(noise(seed.rg), noise(seed.gb), noise(seed.rb)); diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index fdbc1d97163b7ab611a7077282e9b564db562025..70dc94c0d1d05f157bde75f60d93c06e4456acfc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -103,11 +103,11 @@ vec3 toneMapACES_Hill(vec3 color) uniform float exposure; uniform float gamma; -vec3 toneMap(vec3 color) +vec3 toneMap(vec3 color, float gs) { float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r; - color *= exposure * exp_scale; + color *= exposure * exp_scale * gs; #ifdef TONEMAP_ACES_NARKOWICZ color = toneMapACES_Narkowicz(color); @@ -177,12 +177,21 @@ vec3 legacyGamma(vec3 color) return color; } +float legacyGammaApprox() +{ + //TODO -- figure out how to plumb this in as a uniform + float c = 0.5; + float gc = 1.0-pow(c, gamma); + + return gc/c * gamma; +} + void main() { //this is the one of the rare spots where diffuseRect contains linear color values (not sRGB) vec4 diff = texture2D(diffuseRect, vary_fragcoord); - diff.rgb = toneMap(diff.rgb); - diff.rgb = legacyGamma(diff.rgb); + + diff.rgb = toneMap(diff.rgb, legacyGammaApprox()); vec2 tc = vary_fragcoord.xy*screen_res*4.0; vec3 seed = (diff.rgb+vec3(1.0))*vec3(tc.xy, tc.x+tc.y); diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl index a34ade7d77ccc25154c26f2bea9863b33443c5d6..65ea0fd334e6c29551ea08c7c46dc0258a77df5c 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl @@ -141,7 +141,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou // fudge sunlit and amblit to get consistent lighting compared to legacy // midday before PBR was a thing - sunlit = sunlight.rgb; + sunlit = sunlight.rgb * (1.0+sun_up_factor*0.3); amblit = tmpAmbient.rgb * 0.25; additive *= vec3(1.0 - combined_haze); @@ -172,7 +172,7 @@ void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, ou sunlit *= 2.0; // squash ambient to approximate whatever weirdness legacy atmospherics were doing - amblit = ambient_color * 0.5; + amblit = ambient_color * 0.5 * (1.0+sun_up_factor*0.3); amblit *= ambientLighting(norm, light_dir); amblit = srgb_to_linear(amblit);