summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-04-17 09:05:40 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-04-17 09:05:40 -0700
commite40bcc4e16c8baeb3945e89c5d035d89416896e3 (patch)
tree33da94bd7e8c99f8bce20591efd55ebd28fcd6ba /indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
parent119c0a35f15d0f82ebf99507300357609769520b (diff)
NORSPEC-59 and NORSPEC-133 work-around crash with RenderDebugGL on and fix breakage in shaders from Mac changes
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl9
1 files changed, 4 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 8c9fe95590..e8cbf318a1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -136,8 +136,7 @@ void main()
float vertex_color_alpha = vertex_color.a;
#endif
- vec3 normal = vary_norm;
- normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1;
+ vec3 normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1;
normal = vec3(dot(normal.xyz, vary_rotation[0]),
dot(normal.xyz, vary_rotation[1]),
dot(normal.xyz, vary_rotation[2]));
@@ -152,10 +151,10 @@ void main()
color.rgb = atmosLighting(color.rgb);
color.rgb = scaleSoftClip(color.rgb);
- col = vec3(0,0,0);
+ col = vec4(0,0,0,0);
#define LIGHT_LOOP(i) \
- 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);
+ col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
LIGHT_LOOP(1)
LIGHT_LOOP(2)
@@ -165,7 +164,7 @@ void main()
LIGHT_LOOP(6)
LIGHT_LOOP(7)
- color.rgb += diff.rgb * vary_pointlight_col * col;
+ color.rgb += diff.rgb * vary_pointlight_col * col.rgb;
frag_color = color;
}