summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-06-08 18:58:35 -0700
committerMerov Linden <merov@lindenlab.com>2012-06-08 18:58:35 -0700
commit1bfdfcb7b9dd392459b012b0712237716c94a84c (patch)
treebdc4dfb4ef49c209acbdc3e9dd633a5a8a29dbba /indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
parentab954444154de43ee18575a3b0649d0f3045dfd8 (diff)
parentdab5ef9d881bc41bc4924102c939db25dd26e0d9 (diff)
Merge pull from vir/drano
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl9
1 files changed, 6 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 8c96d55342..cf38a2f4f7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -48,7 +48,6 @@ VARYING vec3 vary_ambient;
VARYING vec3 vary_directional;
VARYING vec3 vary_fragcoord;
VARYING vec3 vary_position;
-VARYING vec3 vary_light;
VARYING vec3 vary_pointlight_col;
VARYING vec4 vertex_color;
@@ -64,6 +63,12 @@ uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
uniform vec3 light_diffuse[8];
+float calcDirectionalLight(vec3 n, vec3 l)
+{
+ float a = max(dot(n,l),0.0);
+ return a;
+}
+
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
{
//get light vector
@@ -128,8 +133,6 @@ void main()
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
- vary_light = light_position[0].xyz;
-
vary_ambient = col.rgb*diffuse_color.rgb;
vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));