summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-09-02 00:00:30 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-09-02 00:00:30 -0700
commitd9d33c15973550efdb428a165aacd3ccdd7cc14f (patch)
treea8684ec0cf69dd3f28dd92558e3312b148816bdd /indra
parentce685a12b9acc888a39c336c91ae6272db74ce91 (diff)
SL-18082: PBR: Fix spotlight color and seam
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl10
2 files changed, 16 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
index 3efc9c1689..7e81516f93 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
@@ -125,6 +125,8 @@ vec4 texture2DLodSpecular(vec2 tc, float lod);
vec4 getPosition(vec2 pos_screen);
+const float M_PI = 3.14159265;
+
void main()
{
#if defined(LOCAL_LIGHT_KILL)
@@ -201,8 +203,12 @@ void main()
dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy );
slit = getProjectedLightSpecularColor( pos, n );
- colorDiffuse = shadow * lit * (dlit*0.5 + BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh ));
- colorSpec = shadow * lit * (slit + BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh ));
+ float exposure = M_PI;
+ dlit *= exposure;
+ slit *= exposure;
+
+ colorDiffuse = shadow * lit * dlit * BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh );
+ colorSpec = shadow * lit * slit * BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh );
#if DEBUG_PBR_SPOT_DIFFUSE
colorDiffuse = dlit.rgb; colorSpec = vec3(0);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
index 87b7977f64..f186db5a50 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
@@ -99,6 +99,8 @@ vec4 texture2DLodSpecular(vec2 tc, float lod);
vec4 getPosition(vec2 pos_screen);
+const float M_PI = 3.14159265;
+
void main()
{
#if defined(LOCAL_LIGHT_KILL)
@@ -173,8 +175,12 @@ void main()
dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy );
slit = getProjectedLightSpecularColor( pos, n );
- colorDiffuse = shadow * dist_atten * nl * (dlit*0.5 + BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh ));
- colorSpec = shadow * dist_atten * nl * (slit + BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh ));
+ float exposure = M_PI;
+ dlit *= exposure;
+ slit *= exposure;
+
+ colorDiffuse = shadow * lit * dlit * BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh );
+ colorSpec = shadow * lit * slit * BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh );
#if DEBUG_PBR_SPOT_DIFFUSE
colorDiffuse = dlit.rgb; colorSpec = vec3(0);