summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-09-28 21:21:13 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-09-28 21:21:13 +0300
commit42fa322e76757073ecc8e884f7fd0fb80e0dd4ad (patch)
tree7be5fd8cdbaef3a6b27893a9a3aa33a6d6fe846e /indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
parentc2b55c4362111c124df30eb339461486bda32ec9 (diff)
parentbac6652cdcd2d8333df04c3ebd3a6a7b752328b3 (diff)
Merged master (DRTVWR-497) into DRTVWR-514-keymappings
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl34
1 files changed, 4 insertions, 30 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index a5804220bc..f80f1a985a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -124,41 +124,15 @@ void main()
if (spec.a > 0.0) // specular reflection
{
+ float sa = dot(refnormpersp, light_dir.xyz);
+ vec3 dumbshiny = sunlit * (texture2D(lightFunc, vec2(sa, spec.a)).r);
-#if 1 //EEP
- vec3 npos = -normalize(pos.xyz);
-
- //vec3 ref = dot(pos+lv, norm);
- vec3 h = normalize(light_dir.xyz+npos);
- float nh = dot(norm.xyz, h);
- float nv = dot(norm.xyz, npos);
- float vh = dot(npos, h);
- float sa = nh;
- float fres = pow(1 - dot(h, npos), 5)*0.4+0.5;
-
- float gtdenom = 2 * nh;
- float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh));
-
- if (nh > 0.0)
- {
- float scontrib = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
- vec3 sp = sun_contrib*scontrib / 6.0;
- sp = clamp(sp, vec3(0), vec3(1));
- bloom += dot(sp, sp) / 4.0;
- color += sp * spec.rgb;
- }
-#else //PRODUCTION
- float sa = dot(refnormpersp, light_dir.xyz);
- vec3 dumbshiny = sunlit*(texture2D(lightFunc, vec2(sa, spec.a)).r);
-
// add the two types of shiny together
vec3 spec_contrib = dumbshiny * spec.rgb;
- bloom = dot(spec_contrib, spec_contrib) / 6;
+ bloom = dot(spec_contrib, spec_contrib) / 6;
color.rgb += spec_contrib;
-#endif
-
}
-
+
color.rgb = mix(color.rgb, diffuse.rgb, diffuse.a);
if (envIntensity > 0.0)