diff options
author | Dave Parks <davep@lindenlab.com> | 2011-10-14 17:56:55 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-10-14 17:56:55 -0500 |
commit | 984feefbecd0338618ea499dc1fa44c5a5fe747d (patch) | |
tree | 2114f73857009a983ca7b1ce90e2bf36237c57b9 /indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl | |
parent | 94c137d5c970bc01e3a4dbe8de6a7104085e5ba6 (diff) | |
parent | baa0ff7d3e34053a1dbc8c5207fe899d9e201ee0 (diff) |
merge
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl index 3e0815226c..7059ff31ae 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl @@ -31,21 +31,22 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 atmosGetDiffuseSunlightColor(); vec3 scaleDownLight(vec3 light); +uniform vec4 light_position[8]; +uniform vec3 light_diffuse[8]; + vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol) { - vec4 col; - col.a = color.a; - - + vec4 col = vec4(0,0,0, color.a); + vec3 view = normalize(pos); /// collect all the specular values from each calcXXXLightSpecular() function vec4 specularSum = vec4(0.0); - col.rgb = gl_LightSource[1].diffuse.rgb * calcDirectionalLightSpecular(specularColor, view, norm, gl_LightSource[1].position.xyz, gl_LightSource[1].diffuse.rgb, 1.0); + col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0); col.rgb = scaleDownLight(col.rgb); col.rgb += atmosAmbient(baseCol.rgb); - col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, gl_LightSource[0].position.xyz,atmosGetDiffuseSunlightColor() * baseCol.a, 1.0)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0)); col.rgb = min(col.rgb * color.rgb, 1.0); specularColor.rgb = min(specularColor.rgb * specularSum.rgb, 1.0); |