From d65fb7cec8ce36ce7f6ff082f8d04bdd8bc0208c Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Mon, 25 Nov 2024 20:56:03 -0500 Subject: Drop emissive on old Intel GPUs (#3110) * #3103 Add the ability to disable the emissive buffer for older GPUs with low memory bandwidth. * #3135 Add a "vintage" mode for slower GPUs * #2719 Fix for skies being overbrightened * #2632 Do not apply tonemapping on legacy skies --- .../shaders/class1/windlight/atmosphericsFuncs.glsl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/windlight') diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl index 359bfe8253..205d4bff6d 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -41,6 +41,7 @@ uniform float scene_light_strength; uniform float sun_moon_glow_factor; uniform float sky_sunlight_scale; uniform float sky_ambient_scale; +uniform int classic_mode; float getAmbientClamp() { return 1.0f; } @@ -121,7 +122,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou // brightness of surface both sunlight and ambient sunlit = sunlight.rgb; - amblit = tmpAmbient; + amblit = pow(tmpAmbient.rgb, vec3(0.9)) * 0.57; additive *= vec3(1.0 - combined_haze); @@ -142,18 +143,22 @@ float ambientLighting(vec3 norm, vec3 light_dir) 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); + amblit *= ambientLighting(norm, light_dir); + + if (classic_mode < 1) + { + amblit = srgb_to_linear(amblit); + sunlit = srgb_to_linear(sunlit); + } + // 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 *= sky_sunlight_scale; amblit *= sky_ambient_scale; - - amblit = srgb_to_linear(amblit); - amblit *= ambientLighting(norm, light_dir); } -- cgit v1.2.3