summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-11-27 12:50:03 +0800
committerErik Kundiman <erik@megapahit.org>2024-11-27 12:50:03 +0800
commitda6872a5c1eb133d1ea4d22e9c50c95b53d72296 (patch)
tree052b8e30552e8668741748ba7e9f9df0ba946ca8 /indra/newview/app_settings
parentb815cb96d3f52ff66945ee20c5cb7d135d353300 (diff)
parenta90377df950f83347e988754d15400b47a739cce (diff)
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS2024.09-ExtraFPS
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl20
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl21
3 files changed, 34 insertions, 11 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..bc13e7d1ec 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;
@@ -241,10 +242,10 @@ void main()
calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten);
- vec3 sunlit_linear = srgb_to_linear(sunlit);
+ 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 +261,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;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
index 95110005dc..cec844559f 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
@@ -161,7 +161,7 @@ void main()
vec3 atten;
calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten);
- vec3 sunlit_linear = srgb_to_linear(sunlit);
+ vec3 sunlit_linear = sunlit;
vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
@@ -182,7 +182,7 @@ void main()
// PBR IBL
float gloss = 1.0 - perceptualRoughness;
- vec3 irradiance = vec3(0);
+ vec3 irradiance = amblit;
vec3 radiance = vec3(0);
sampleReflectionProbes(irradiance, radiance, vary_position.xy*0.5+0.5, pos.xyz, norm.xyz, gloss, true, amblit);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index f04dca2b36..0166cd6e0c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -36,6 +36,7 @@
uniform float emissive_brightness; // fullbright flag, 1.0 == fullbright, 0.0 otherwise
uniform int sun_up_factor;
+uniform int classic_mode;
vec4 applySkyAndWaterFog(vec3 pos, vec3 additive, vec3 atten, vec4 color);
vec3 scaleSoftClipFragLinear(vec3 l);
@@ -329,10 +330,10 @@ void main()
vec3 atten;
calcAtmosphericVarsLinear(pos.xyz, norm.xyz, light_dir, sunlit, amblit, additive, atten);
- vec3 sunlit_linear = srgb_to_linear(sunlit);
+ vec3 sunlit_linear = sunlit;
vec3 amblit_linear = amblit;
- vec3 ambenv;
+ vec3 ambenv = amblit;
vec3 glossenv;
vec3 legacyenv;
sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, pos.xy*0.5+0.5, pos.xyz, norm.xyz, glossiness, env, true, amblit_linear);
@@ -340,8 +341,20 @@ void main()
color = ambenv;
float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0);
- vec3 sun_contrib = min(da, shadow) * sunlit_linear;
- color.rgb += sun_contrib;
+ if (classic_mode > 0)
+ {
+ da = pow(da,1.2);
+ vec3 sun_contrib = vec3(min(da, shadow));
+
+ 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(da, shadow) * sunlit_linear;
+ color.rgb += sun_contrib;
+ }
+
color *= diffcol.rgb;
vec3 refnormpersp = reflect(pos.xyz, norm.xyz);