summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-05-17 12:27:50 -0500
committerDave Parks <davep@lindenlab.com>2013-05-17 12:27:50 -0500
commit559934705fd766430ccdd4b4e41e26a277f63637 (patch)
treeab856827f2fba86e25cdfc436068e272adf74b00 /indra/newview/app_settings
parente6c2a7652952f60f26cdee4484128c45340240ee (diff)
Backout OpenGL 2.1 compatibility attempt
Diffstat (limited to 'indra/newview/app_settings')
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/alphaF.glsl12
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/alphaV.glsl13
2 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 84e83d4c8b..50b43f6a8d 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -60,10 +60,14 @@ VARYING vec3 vary_ambient;
VARYING vec3 vary_directional;
VARYING vec3 vary_fragcoord;
VARYING vec3 vary_position;
-VARYING vec4 vary_pointlight_col;
+VARYING vec3 vary_pointlight_col;
VARYING vec2 vary_texcoord0;
VARYING vec3 vary_norm;
+#ifdef USE_VERTEX_COLOR
+VARYING vec4 vertex_color;
+#endif
+
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
@@ -212,7 +216,7 @@ void main()
diff.rgb = pow(diff.rgb, vec3(2.2f, 2.2f, 2.2f));
#ifdef USE_VERTEX_COLOR
- float vertex_color_alpha = vary_pointlight_col.a;
+ float vertex_color_alpha = vertex_color.a;
#else
float vertex_color_alpha = 1.0;
#endif
@@ -221,7 +225,7 @@ void main()
vec3 l = light_position[0].xyz;
vec3 dlight = calcDirectionalLight(normal, l) * 2.6;
- dlight = dlight * vary_directional.rgb * vary_pointlight_col.rgb;
+ dlight = dlight * vary_directional.rgb * vary_pointlight_col;
#if HAS_SHADOW
vec4 col = vec4(vary_ambient + dlight * shadow, vertex_color_alpha);
@@ -246,7 +250,7 @@ void main()
LIGHT_LOOP(6)
LIGHT_LOOP(7)
- color.rgb += diff.rgb * vary_pointlight_col.rgb * col.rgb;
+ color.rgb += diff.rgb * vary_pointlight_col * col.rgb;
frag_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index dc497e063b..77d02b36ff 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -69,8 +69,11 @@ VARYING vec3 vary_ambient;
VARYING vec3 vary_directional;
VARYING vec3 vary_fragcoord;
VARYING vec3 vary_position;
-VARYING vec4 vary_pointlight_col;
+VARYING vec3 vary_pointlight_col;
+#ifdef USE_VERTEX_COLOR
+VARYING vec4 vertex_color;
+#endif
VARYING vec2 vary_texcoord0;
@@ -183,9 +186,9 @@ void main()
- vary_pointlight_col.rgb = diff;
- vary_pointlight_col.a = col.a;
+ vary_pointlight_col = diff;
+
col.rgb = vec3(0,0,0);
// Add windlight lights
@@ -197,7 +200,9 @@ void main()
col.rgb = col.rgb*diff.rgb;
-
+#ifdef USE_VERTEX_COLOR
+ vertex_color = col;
+#endif
#ifdef HAS_SKIN
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);