summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-07-26 10:42:12 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-08-02 09:44:45 -0700
commitd621e58ad49e1a67315da9362a404cf2b7683a99 (patch)
tree2aca801d23ea1d039da1e9bf8664726ecae21e02 /indra/newview/app_settings/shaders/class3
parent86de20e711dd077e18f5776de1bc4b26ebd62c3d (diff)
SL-17762: Cleanup: Move texture2DLodSpecular() to deferredUtil, remove redundant first arg
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl22
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl18
2 files changed, 4 insertions, 36 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
index 90445cb0ef..f8655ccf3b 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
@@ -86,25 +86,7 @@ vec3 getProjectedLightSpecularColor(vec3 pos, vec3 n);
vec2 getScreenXY(vec4 clip);
void initMaterial( vec3 diffuse, vec3 packedORM, out float alphaRough, out vec3 c_diff, out vec3 reflect0, out vec3 reflect90, out float specWeight );
vec3 srgb_to_linear(vec3 cs);
-
-vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
-{
- vec4 ret = texture2DLod(projectionMap, tc, lod);
- ret.rgb = srgb_to_linear(ret.rgb);
- vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
-
- float det = min(lod/(proj_lod*0.5), 1.0);
-
- float d = min(dist.x, dist.y);
-
- d *= min(1, d * (proj_lod - lod));
-
- float edge = 0.25*det;
-
- ret *= clamp(d/edge, 0.0, 1.0);
-
- return ret;
-}
+vec4 texture2DLodSpecular(vec2 tc, float lod);
vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
@@ -261,7 +243,7 @@ void main()
stc.x > 0.0 &&
stc.y > 0.0)
{
- final_color += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity;
+ final_color += color.rgb * texture2DLodSpecular(stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity;
}
}
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
index c9e635ab3f..300e3b8e76 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
@@ -85,21 +85,7 @@ vec3 getProjectedLightSpecularColor(vec3 pos, vec3 n);
vec2 getScreenXY(vec4 clip_point);
void initMaterial( vec3 diffuse, vec3 packedORM, out float alphaRough, out vec3 c_diff, out vec3 reflect0, out vec3 reflect90, out float specWeight );
vec3 srgb_to_linear(vec3 c);
-
-vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
-{
- vec4 ret = texture2DLod(projectionMap, tc, lod);
- ret.rgb = srgb_to_linear(ret.rgb);
-
- vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
- float det = min(lod/(proj_lod*0.5), 1.0);
- float d = min(dist.x, dist.y);
- d *= min(1, d * (proj_lod - lod));
- float edge = 0.25*det;
- ret *= clamp(d/edge, 0.0, 1.0);
-
- return ret;
-}
+vec4 texture2DLodSpecular(vec2 tc, float lod);
vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
@@ -251,7 +237,7 @@ void main()
stc.x > 0.0 &&
stc.y > 0.0)
{
- final_color += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity;
+ final_color += color.rgb * texture2DLodSpecular(stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity;
}
}
}