summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-05-01 14:54:41 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-05-01 14:54:41 -0700
commite78184a58ca9ff27d76692892bbb5323b5686db9 (patch)
tree887d6d9739dae4d7ab2060351688da1f78725783 /indra/newview/app_settings/shaders/class2
parentef7c661dc02458b5920ccbc11a565d8cae9b9de0 (diff)
parent5534078e9d371782148f08e40ca55bf0b52aa512 (diff)
Merge vwr-dev-mat
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-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);