summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-07-21 08:15:21 -0700
committerGraham Linden <graham@lindenlab.com>2013-07-21 08:15:21 -0700
commit94abe75dea90ee91dd044161d8587279b0bfae13 (patch)
treedd5a0c36a7c28f44bc6fd5ce2e0aec9c189a0a1d /indra/newview/app_settings/shaders/class1/deferred
parent6c186b0c4137220697999c9ffc5e8a23058f5a4d (diff)
NORSPEC-315 NORSPEC-316 NORSPEC-312 fix various haze and gamma correction issues, alpha-blend objects still missing haze underwater
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/alphaF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightAlphaMaskF.glsl7
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl12
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl13
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/waterF.glsl5
6 files changed, 30 insertions, 14 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 640e273415..b64852f17b 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -281,7 +281,7 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col_linear * col.rgb;
color.rgb = linear_to_srgb(color.rgb);
-
+ //color.rgb = vec3(1,0,1);
frag_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightAlphaMaskF.glsl
index 3d93583e1e..a74256de81 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightAlphaMaskF.glsl
@@ -71,7 +71,8 @@ void main()
vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
#endif
- if (color.a < minimum_alpha)
+ float final_alpha = color.a * vertex_color.a;
+ if (final_alpha < minimum_alpha)
{
discard;
}
@@ -83,8 +84,8 @@ void main()
color.rgb = fullbrightScaleSoftClip(color.rgb);
color.rgb = linear_to_srgb(color.rgb);
-
+ //color.rgb = vec3(1,0,1);
frag_color.rgb = color.rgb;
- frag_color.a = color.a;
+ frag_color.a = final_alpha;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 33c07a6e08..5876efedec 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -69,14 +69,15 @@ void main()
vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
#endif
- color.rgb *= vertex_color.rgb;
+
color.rgb = srgb_to_linear(color.rgb);
+ color.rgb *= vertex_color.rgb;
color.rgb = fullbrightAtmosTransport(color.rgb);
color.rgb = fullbrightScaleSoftClip(color.rgb);
color.rgb = linear_to_srgb(color.rgb);
-
+ //color.rgb = vec3(1,0,1);
frag_color.rgb = color.rgb;
frag_color.a = color.a;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 9ce4d89df7..954a27b698 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -266,6 +266,13 @@ vec4 getPosition_d(vec2 pos_screen, float depth)
return pos;
}
+#ifndef WATER_FOG
+vec3 getPositionEye()
+{
+ return vary_PositionEye;
+}
+#endif
+
vec3 getSunlitColor()
{
return vary_SunlitColor;
@@ -728,6 +735,10 @@ void main()
glare = min(glare, 1.0);
float al = max(diffcol.a,glare)*vertex_color.a;
+
+ //convert to gamma space for display on screen
+ col.rgb = linear_to_srgb(col.rgb);
+
#ifdef WATER_FOG
vec4 temp = applyWaterFogDeferred(pos, vec4(col.rgb, al));
col.rgb = temp.rgb;
@@ -738,6 +749,7 @@ void main()
frag_color.a = al;
#else
+ //final_color.rgb = vec3(1,0,1);
frag_data[0] = final_color;
frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent.
frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity.
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 953f0189f0..950512a79d 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -436,16 +436,15 @@ void main()
if (norm.w < 0.5)
{
col = mix(atmosLighting(col), fullbrightAtmosTransport(col), diffuse.a);
-
- #ifdef WATER_FOG
- vec4 fogged = applyWaterFogDeferred(pos,vec4(col, bloom));
- col = fogged.rgb;
- bloom = fogged.a;
- #endif
-
col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a);
}
+ #ifdef WATER_FOG
+ vec4 fogged = applyWaterFogDeferred(pos,vec4(col, bloom));
+ col = fogged.rgb;
+ bloom = fogged.a;
+ #endif
+
col = srgb_to_linear(col);
//col = vec3(1,0,1);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index 17288873c8..7415415290 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -192,7 +192,10 @@ void main()
//wavef = normalize(wavef);
vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz;
- frag_data[0] = vec4(linear_to_srgb(color.rgb), 0.5); // diffuse
+ // this is needed for materials in reflections, but not otherwise
+ //
+ //frag_data[0] = vec4(linear_to_srgb(color.rgb), 0.5); // diffuse
+ frag_data[0] = vec4(color.rgb, 0.5); // diffuse
frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
frag_data[2] = vec4(encode_normal(screenspacewavef), 0.0, 0.0); // normalxyz, displace
}