summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-04-15 14:12:16 -0500
committerDave Parks <davep@lindenlab.com>2013-04-15 14:12:16 -0500
commit359b6cad5b8ae2a88927d53eaa12b58a126e0d1c (patch)
tree0658e64e8f4e2942a45b33c44b040275cbb51f1c /indra/newview/app_settings/shaders
parent8025b8b2bc6028ed268e191d432cb3f740e351db (diff)
NORSPEC-117 Fix distance attenuation to not use pow(lit, 0.7) function so distance falloff is still soft
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl4
6 files changed, 7 insertions, 17 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 5329ae9dd7..3bd433c283 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -127,9 +127,9 @@ void main()
dist_atten *= noise;
- float lit = da * dist_atten;
+ float lit = pow(da, 0.7) * dist_atten;
- lit = pow(lit,0.7);
+
vec3 col = light_col[i].rgb*lit*diff;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 9746218ea6..959a85330e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -201,9 +201,7 @@ void main()
vec3 lcol = color.rgb * plcol.rgb * plcol.a;
- lit = da * dist_atten * noise;
-
- lit = pow(lit, 0.7);
+ lit = pow(da, 0.7) * dist_atten * noise;
col = lcol*lit*diff_tex;
amb_da += (da*0.5)*proj_ambiance;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 27863b0095..6976fc7bd9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -111,10 +111,8 @@ void main()
vec3 col = texture2DRect(diffuseRect, frag.xy).rgb;
float fa = falloff+1.0;
float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
- float lit = da * dist_atten * noise;
+ float lit = pow(da, 0.7) * dist_atten * noise;
- lit = pow(lit, 0.7);
-
col = color.rgb*lit*col;
vec4 spec = texture2DRect(specularRect, frag.xy);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index d7f0ab6d8e..918cdce040 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -204,9 +204,7 @@ void main()
vec3 lcol = color.rgb * plcol.rgb * plcol.a;
- lit = da * dist_atten * noise;
-
- lit = pow(lit, 0.7);
+ lit = pow(da, 0.7) * dist_atten * noise;
col = lcol*lit*diff_tex;
amb_da += (da*0.5)*proj_ambiance;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index b3ab8fd510..90b6856c5c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -213,9 +213,7 @@ void main()
vec3 lcol = color.rgb * plcol.rgb * plcol.a;
- lit = da * dist_atten * noise;
-
- lit = pow(lit, 0.7);
+ lit = pow(da,0.7) * dist_atten * noise;
col = lcol*lit*diff_tex*shadow;
amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 43fc5dbc5e..5fd6f0afb7 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -214,9 +214,7 @@ void main()
vec3 lcol = color.rgb * plcol.rgb * plcol.a;
- lit = da * dist_atten * noise;
-
- lit = pow(lit, 0.7);
+ lit = pow(da, 0.7) * dist_atten * noise;
col = lcol*lit*diff_tex*shadow;
amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;