diff options
author | Dave Parks <davep@lindenlab.com> | 2022-09-28 00:15:34 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-09-28 00:15:34 -0500 |
commit | a63fcfc9d584075bb263ccf10857852b3327be43 (patch) | |
tree | 60d7d5f76bed82086d01a55130dfb4a47c953cc9 | |
parent | 67c7a13647d7b337efc97c7c48386b0b60918915 (diff) |
SL-18190 Remove some (likely) superfluous color space conversions
3 files changed, 9 insertions, 18 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl index ecf1545d2d..e578f618da 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl @@ -32,32 +32,27 @@ uniform int no_atmo; vec3 srgb_to_linear(vec3 col); vec3 linear_to_srgb(vec3 col); -vec3 atmosFragLightingLinear(vec3 light, vec3 additive, vec3 atten) +vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten) { if (no_atmo == 1) { return light; } - - light = linear_to_srgb(light); - additive = linear_to_srgb(additive); - atten = linear_to_srgb(atten); - light *= atten.r; light += additive; - return srgb_to_linear(light); + return light * 2.0; } - -vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten) +vec3 atmosFragLightingLinear(vec3 light, vec3 additive, vec3 atten) { if (no_atmo == 1) { return light; } + light *= atten.r; light += additive; - return light * 2.0; + return light; } vec3 atmosLighting(vec3 light) diff --git a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl index 6dfb2e7cf6..a32a572461 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl @@ -32,16 +32,15 @@ vec3 srgb_to_linear(vec3 col); vec3 linear_to_srgb(vec3 col); vec3 scaleSoftClipFragLinear(vec3 light) -{ +{ // identical to non-linear version and that's probably close enough if (no_atmo == 1) { return light; } - light = linear_to_srgb(light); //soft clip effect: light = 1. - clamp(light, vec3(0.), vec3(1.)); light = 1. - pow(light, vec3(gamma)); // s/b inverted already CPU-side - return srgb_to_linear(light); + return light; } vec3 scaleSoftClipFrag(vec3 light) diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl index 4bf2275e6a..ecf0430a88 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -49,12 +49,9 @@ vec3 atmosTransport(vec3 light) vec3 fullbrightAtmosTransportFragLinear(vec3 light, vec3 additive, vec3 atten) { - light = linear_to_srgb(light); - additive = linear_to_srgb(additive); - atten = linear_to_srgb(atten); - + // same as non-linear version, probably fine float brightness = dot(light.rgb * 0.5, vec3(0.3333)) + 0.1; - return srgb_to_linear(mix(atmosTransportFrag(light.rgb, additive, atten), light.rgb + additive, brightness * brightness)); + return mix(atmosTransportFrag(light.rgb, additive, atten), light.rgb + additive, brightness * brightness); } vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) |