summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl16
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl1
2 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 9ddbb6da6a..a6b0f7e7c1 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -79,10 +79,17 @@ vec3 decode_normal (vec2 enc)
return n;
}
+vec4 correctWithGamma(vec4 col)
+{
+ return vec4(pow(col.rgb, vec3(2.2)), col.a);
+}
+
+
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
-
+ ret = correctWithGamma(ret);
+
vec2 dist = tc-vec2(0.5);
float det = max(1.0-lod/(proj_lod*0.5), 0.0);
@@ -97,7 +104,8 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
-
+ ret = correctWithGamma(ret);
+
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
float det = min(lod/(proj_lod*0.5), 1.0);
@@ -114,7 +122,8 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
-
+ ret = correctWithGamma(ret);
+
vec2 dist = tc-vec2(0.5);
float d = dot(dist,dist);
@@ -243,6 +252,7 @@ void main()
if (spec.a > 0.0)
{
vec3 npos = -normalize(pos);
+ dlit *= min(da*6.0, 1.0) * dist_atten;
//vec3 ref = dot(pos+lv, norm);
vec3 h = normalize(lv+npos);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index aa964fa0a3..91ff1f1e76 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -248,6 +248,7 @@ void main()
if (spec.a > 0.0)
{
+ dlit *= min(da*6.0, 1.0) * dist_atten;
vec3 npos = -normalize(pos);
//vec3 ref = dot(pos+lv, norm);