summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-12-06 14:03:46 +0800
committerErik Kundiman <erik@megapahit.org>2024-12-06 14:03:46 +0800
commit70e36b3ff4673888a951f1f3487176ec3ca44fe5 (patch)
tree1fffba9d0bc5a643bfa388e7ccae54332bbd4a25 /indra/newview/app_settings/shaders/class3
parentfda6acb4be1145ac1dc6c33859d8a65dcfa8aecb (diff)
parent37f92c1698cd0cef1aa3d8a21a13cd99510e86e9 (diff)
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl7
5 files changed, 33 insertions, 13 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index 0166cd6e0c..a4d3962d12 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -178,8 +178,10 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
}
}
}
-
- return max(col, vec3(0.0, 0.0, 0.0));
+ float final_scale = 1.0;
+ if (classic_mode > 0)
+ final_scale = 0.9;
+ return max(col * final_scale, vec3(0.0, 0.0, 0.0));
}
#else
@@ -329,7 +331,8 @@ void main()
vec3 additive;
vec3 atten;
calcAtmosphericVarsLinear(pos.xyz, norm.xyz, light_dir, sunlit, amblit, additive, atten);
-
+ if (classic_mode > 0)
+ sunlit *= 1.35;
vec3 sunlit_linear = sunlit;
vec3 amblit_linear = amblit;
@@ -418,8 +421,10 @@ void main()
glare *= 1.0-emissive;
glare = min(glare, 1.0);
float al = max(diffcol.a, glare) * vertex_color.a;
-
- frag_color = max(vec4(color, al), vec4(0));
+ float final_scale = 1;
+ if (classic_mode > 0)
+ final_scale = 1.1;
+ frag_color = max(vec4(color * final_scale, al), vec4(0));
#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer
// deferred path // See: C++: addDeferredAttachment(), shader: softenLightF.glsl
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
index d4359e7aa3..b11c2644aa 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
@@ -38,6 +38,7 @@ uniform vec4 light_col[LIGHT_COUNT]; // .a = falloff
uniform vec2 screen_res;
uniform float far_z;
uniform mat4 inv_proj;
+uniform int classic_mode;
in vec4 vary_fragcoord;
@@ -169,8 +170,10 @@ void main()
}
}
}
-
- frag_color.rgb = max(final_color, vec3(0));
+ float final_scale = 1.0;
+ if (classic_mode > 0)
+ final_scale = 0.9;
+ frag_color.rgb = max(final_color * final_scale, vec3(0));
frag_color.a = 0.0;
#ifdef IS_AMD_CARD
diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
index 1ca4024c69..6a248f25bc 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
@@ -44,6 +44,7 @@ uniform vec2 screen_res;
uniform mat4 inv_proj;
uniform vec4 viewport;
+uniform int classic_mode;
void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist);
float calcLegacyDistanceAttenuation(float distance, float falloff);
@@ -149,7 +150,9 @@ void main()
discard;
}
}
-
- frag_color.rgb = max(final_color, vec3(0));
+ float final_scale = 1.0;
+ if (classic_mode > 0)
+ final_scale = 0.9;
+ frag_color.rgb = max(final_color * final_scale, vec3(0));
frag_color.a = 0.0;
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index ae6c23be05..2e288184bf 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -155,6 +155,9 @@ void main()
calcAtmosphericVarsLinear(pos.xyz, gb.normal, light_dir, sunlit, amblit, additive, atten);
+ if (classic_mode > 0)
+ sunlit *= 1.35;
+
vec3 sunlit_linear = sunlit;
vec3 amblit_linear = amblit;
@@ -224,7 +227,7 @@ void main()
da = pow(da,1.2);
vec3 sun_contrib = vec3(min(da, scol));
- color.rgb = srgb_to_linear(color.rgb * 0.9 + linear_to_srgb(sun_contrib) * sunlit_linear * 0.7);
+ 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
@@ -272,6 +275,9 @@ void main()
}
//color.r = classic_mode > 0 ? 1.0 : 0.0;
- frag_color.rgb = max(color.rgb, vec3(0)); //output linear since local lights will be added to this shader's results
+ float final_scale = 1;
+ if (classic_mode > 0)
+ final_scale = 1.1;
+ frag_color.rgb = max(color.rgb * final_scale, vec3(0)); //output linear since local lights will be added to this shader's results
frag_color.a = 0.0;
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
index d13e71445f..017f8bc844 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
@@ -47,6 +47,7 @@ uniform vec3 proj_origin; //origin of projection to be used for angular attenuat
uniform float sun_wash;
uniform int proj_shadow_idx;
uniform float shadow_fade;
+uniform int classic_mode;
// Light params
#if defined(MULTI_SPOTLIGHT)
@@ -267,8 +268,10 @@ void main()
//not sure why, but this line prevents MATBUG-194
final_color = max(final_color, vec3(0.0));
-
+ float final_scale = 1.0;
+ if (classic_mode > 0)
+ final_scale = 0.9;
//output linear
- frag_color.rgb = final_color;
+ frag_color.rgb = final_color * final_scale;
frag_color.a = 0.0;
}