summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/lighting
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-28 18:01:12 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-28 18:01:12 -0800
commit73c98e1c1e3899aaae1de6bac51f9e21ea6432a1 (patch)
tree9ba66ed14792191a2abed48f2e0e9ff1227892a4 /indra/newview/app_settings/shaders/class2/lighting
parentc3b37faba3cba425d749345a978ddec16bbd1338 (diff)
enable basic directional lighting for basic/atmospheric shaders - yay.
next, needs the non-shader GL lighting model to be equally dumb (it's too smart - kill the spot angle.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/lighting')
-rw-r--r--indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl8
1 files changed, 5 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
index f4c59734a4..fd264b9e74 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
@@ -7,6 +7,7 @@
float calcDirectionalLight(vec3 n, vec3 l);
float calcPointLight(vec3 v, vec3 n, vec4 lp, float la);
+float calcPointLight2(vec3 v, vec3 n, vec4 lp, vec3 ln, float la);
vec3 atmosAmbient(vec3 light);
vec3 atmosAffectDirectionalLight(float lightIntensity);
@@ -18,9 +19,10 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
// Collect normal lights (need to be divided by two, as we later multiply by 2)
col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz);
- col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation);
- col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation);
- //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation);
+
+ col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation);
+ col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation);
+ //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight2(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation);
col.rgb = scaleDownLight(col.rgb);
// Add windlight lights