diff options
author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2024-11-25 20:56:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 20:56:03 -0500 |
commit | d65fb7cec8ce36ce7f6ff082f8d04bdd8bc0208c (patch) | |
tree | 0005e8ec095fb31dcd4f8b079af585e3333c365f /indra/newview/app_settings/shaders/class1/windlight | |
parent | 7ef6e8fce763eb529ed160ea4ff11e6125e32ed5 (diff) |
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
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/windlight')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl | 15 |
1 files changed, 10 insertions, 5 deletions
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); } |