From bc7856098f70371dd392c74689df267cce819aa7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 2 Mar 2023 16:36:03 -0600 Subject: SL-19281 Unify handling of haze and gamma between fullbright and not and move haze back to sRGB color space to stay consistent with sky colors. Also fix broken "roughness" stuck at 0.2. --- .../newview/app_settings/shaders/class2/deferred/alphaF.glsl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl') diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index e2694e060e..ef35bf3fd7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -250,6 +250,9 @@ void main() calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten); + vec3 sunlit_linear = srgb_to_linear(sunlit); + vec3 amblit_linear = amblit; + vec3 irradiance; vec3 glossenv; vec3 legacyenv; @@ -266,7 +269,7 @@ void main() color.a = final_alpha; - vec3 sun_contrib = min(final_da, shadow) * sunlit; + vec3 sun_contrib = min(final_da, shadow) * sunlit_linear; color.rgb = max(amblit, irradiance); @@ -274,8 +277,10 @@ void main() color.rgb *= diffuse_linear.rgb; + color.rgb = linear_to_srgb(color.rgb); color.rgb = atmosFragLightingLinear(color.rgb, additive, atten); color.rgb = scaleSoftClipFragLinear(color.rgb); + color.rgb = srgb_to_linear(color.rgb); vec4 light = vec4(0,0,0,0); @@ -294,8 +299,9 @@ void main() color.rgb += light.rgb; #endif // !defined(LOCAL_LIGHT_KILL) + #ifdef WATER_FOG - color = applyWaterFogViewLinear(pos.xyz, color, sunlit); + color = applyWaterFogViewLinear(pos.xyz, color, sunlit_linear); #endif // WATER_FOG #endif // #else // FOR_IMPOSTOR @@ -303,6 +309,7 @@ void main() #ifdef IS_HUD color.rgb = linear_to_srgb(color.rgb); #endif + frag_color = color; } -- cgit v1.2.3