summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2013-04-15 19:40:12 -0400
committerGeenz <geenz@geenzo.com>2013-04-15 19:40:12 -0400
commitc72c3691ecf83875d4ee3e0784b3e76cb4b4633a (patch)
tree7959f729f94b8fcd85bb3b32a7b5bb271c746b47 /indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
parent39544a3b06e3221602444eb81c7df8c1030c6bb5 (diff)
parentfafa21315f043ab51e3373e825c85646685778a6 (diff)
Merged Graham's stuff amongst others.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
index 10e9670894..e872dadcc1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
@@ -114,7 +114,10 @@ void main()
vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy);
- vec3 dlight = calcDirectionalLight(vary_norm, light_position[0].xyz) * vary_directional.rgb * vary_pointlight_col;
+ vec3 n = vary_norm;
+ vec3 l = light_position[0].xyz;
+ vec3 dlight = calcDirectionalLight(n, l);
+ dlight = dlight * vary_directional.rgb * vary_pointlight_col;
vec4 col = vec4(vary_ambient + dlight, vertex_color.a);
vec4 color = diff * col;
@@ -123,12 +126,23 @@ void main()
color.rgb = scaleSoftClip(color.rgb);
vec3 light_col = vec3(0,0,0);
-
+#if MAC_GEFORCE_HACK
+ #define LIGHT_LOOP(i) \
+ light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
+
+ LIGHT_LOOP(1)
+ LIGHT_LOOP(2)
+ LIGHT_LOOP(3)
+ LIGHT_LOOP(4)
+ LIGHT_LOOP(5)
+ LIGHT_LOOP(6)
+ LIGHT_LOOP(7)
+#else
for (int i = 2; i < 8; i++)
{
light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
}
-
+#endif
color.rgb += diff.rgb * vary_pointlight_col * light_col;
frag_color = color;