diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-24 18:44:39 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-24 18:44:39 +0100 |
commit | 98cc2365034a93c69704daa69efb389799cc9627 (patch) | |
tree | 4c3ec75b78a26a736f18a2153af025040ae05a4b /indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | |
parent | 6ba23344c95157793af9e4154933ae8df61630e8 (diff) |
Backed out changeset a62bf7c0af21
Backing out this merge that I pushed (prematurely) to the wrong place.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 8a90199b7c..d6534083cf 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -82,8 +82,7 @@ void main() discard; } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; norm = normalize(norm); float l_dist = -dot(lv, proj_n); @@ -180,6 +179,21 @@ void main() } } + /*if (spec.a > 0.0) + { + //vec3 ref = reflect(normalize(pos), norm); + float sa = dot(normalize(lv-normalize(pos)),norm);; + //sa = max(sa, 0.0); + //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); + sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa *= noise; + col += da*sa*lcol*spec.rgb; + }*/ + + //attenuate point light contribution by SSAO component + col *= texture2DRect(lightMap, frag.xy).g; + + gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } |