diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 7357e27117..d6569cda33 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -36,6 +36,7 @@ out vec4 frag_color; uniform mat3 env_mat; uniform vec3 sun_dir; uniform vec3 moon_dir; +uniform int classic_mode; #ifdef USE_DIFFUSE_TEX uniform sampler2D diffuseMap; @@ -162,7 +163,10 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec // no spec for alpha shader... } - col = max(col, vec3(0)); + float final_scale = 1.0; + if (classic_mode > 0) + final_scale = 0.9; + col = max(col * final_scale, vec3(0)); return col; } @@ -240,11 +244,12 @@ void main() vec3 atten; calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten); - - vec3 sunlit_linear = srgb_to_linear(sunlit); + if (classic_mode > 0) + sunlit *= 1.35; + vec3 sunlit_linear = sunlit; vec3 amblit_linear = amblit; - vec3 irradiance; + vec3 irradiance = amblit; vec3 glossenv; vec3 legacyenv; sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, frag, pos.xyz, norm.xyz, 0.0, 0.0, true, amblit_linear); @@ -260,11 +265,20 @@ void main() color.a = final_alpha; - vec3 sun_contrib = min(final_da, shadow) * sunlit_linear; - color.rgb = irradiance; + if (classic_mode > 0) + { + final_da = pow(final_da,1.2); + vec3 sun_contrib = vec3(min(final_da, shadow)); - color.rgb += sun_contrib; + color.rgb = srgb_to_linear(color.rgb * 0.9 + linear_to_srgb(sun_contrib) * sunlit_linear * 0.7); + sunlit_linear = srgb_to_linear(sunlit_linear); + } + else + { + vec3 sun_contrib = min(final_da, shadow) * sunlit_linear; + color.rgb += sun_contrib; + } color.rgb *= diffuse_linear.rgb; @@ -286,11 +300,15 @@ void main() color.rgb = applySkyAndWaterFog(pos.xyz, additive, atten, color).rgb; #endif // #else // FOR_IMPOSTOR - + float final_scale = 1; + if (classic_mode > 0) + final_scale = 1.1; #ifdef IS_HUD color.rgb = linear_to_srgb(color.rgb); + final_scale = 1; #endif + color.rgb *= final_scale; frag_color = max(color, vec4(0)); } |