diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2022-10-11 15:29:08 -0700 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2022-10-13 11:12:59 -0700 |
commit | 8a82305068f68ae4075be7ff86b5b4af8a71e5c3 (patch) | |
tree | 1faad92236a8c2a666045163f95c9cd054c8148b /indra/newview/app_settings/shaders/class2/deferred | |
parent | 3ac80d7ec2a1c04e3e4f191285aa5a19f071a40d (diff) |
SL-18340: Fix PBR alpha materials treating spotlight as point light
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl index 922da0c441..d7da50e25e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl @@ -126,7 +126,12 @@ vec3 calcPointLightOrSpotLight(vec3 diffuseColor, vec3 specularColor, float dist_atten = calcLegacyDistanceAttenuation(dist, falloff); - vec3 intensity = dist_atten * lightColor * 3.0; + // spotlight coefficient. + float spot = max(dot(-ld, lv), is_pointlight); + // spot*spot => GL_SPOT_EXPONENT=2 + float spot_atten = spot*spot; + + vec3 intensity = spot_atten * dist_atten * lightColor * 3.0; color = intensity*pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, n.xyz, v, lv); } |