diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
4 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index db42a54e42..338532e71d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -137,6 +137,7 @@ void main() if (spec.a > 0.0) { + lit = min(da*6.0, 1.0) * dist_atten; //vec3 ref = dot(pos+lv, norm); vec3 h = normalize(lv+npos); float nh = dot(norm, h); diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 893a92299a..6675bfde69 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -78,9 +78,15 @@ 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); @@ -96,7 +102,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); @@ -113,7 +120,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); @@ -226,6 +234,8 @@ 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); diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 36406cbf57..69cdb2ce71 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -119,6 +119,8 @@ void main() vec4 spec = texture2DRect(specularRect, frag.xy); if (spec.a > 0.0) { + lit = min(da*6.0, 1.0) * dist_atten; + vec3 npos = -normalize(pos); vec3 h = normalize(lv+npos); float nh = dot(norm, h); diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index b29f676ecc..c918a42c73 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -234,6 +234,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); |