diff options
| author | Erik Kundiman <erik@megapahit.org> | 2024-11-26 12:05:25 +0800 | 
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2024-11-26 12:05:25 +0800 | 
| commit | a40795bd6ffcfff71bead4869d79cf5a73d5a7af (patch) | |
| tree | 6c4c1fbb421f737c0b62fcda51ca7ca0ce8294f4 /indra/newview/app_settings/shaders/class1/windlight | |
| parent | 30842e230e2b3d365e8415f0350f8d10ce8b0637 (diff) | |
| parent | d65fb7cec8ce36ce7f6ff082f8d04bdd8bc0208c (diff) | |
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
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 af10ecce9a..02108a9ec1 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);  } | 
