summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
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/class1
parentef7c661dc02458b5920ccbc11a565d8cae9b9de0 (diff)
parent5534078e9d371782148f08e40ca55bf0b52aa512 (diff)
Merge vwr-dev-mat
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl1
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl14
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl2
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl3
-rwxr-xr-xindra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl4
5 files changed, 17 insertions, 7 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 100755
--- 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 97ccc77ca8..79f94fb131 100755
--- 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,6 +102,7 @@ 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));
@@ -113,6 +120,7 @@ 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);
@@ -185,7 +193,7 @@ void main()
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
vec3 dlit = vec3(0, 0, 0);
-
+
float noise = texture2D(noiseMap, frag.xy/128.0).b;
if (proj_tc.z > 0.0 &&
proj_tc.x < 1.0 &&
@@ -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);
@@ -238,7 +248,7 @@ void main()
float gtdenom = 2 * nh;
float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh));
-
+
if (nh > 0.0)
{
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
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 100755
--- 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 4ce9cd6b40..c918a42c73 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -216,7 +216,7 @@ void main()
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
dlit = color.rgb * plcol.rgb * plcol.a;
-
+
col = dlit*lit*diff_tex;
//amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
}
@@ -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);
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
index 8494ffba52..3dab224258 100755
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
@@ -50,9 +50,5 @@ void main()
calcAtmospherics(pos.xyz);
- vertex_color = emissive;
-
gl_Position = projection_matrix*vec4(pos, 1.0);
-
-
}