summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-07-06 20:50:00 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-07-06 20:50:00 -0700
commit9b956c774c373f058ee64fe60ab1fadfd7c8fa21 (patch)
tree04c62eddfd5612eb03617914450ad1004679c18e /indra/newview/app_settings/shaders/class3
parent5862d15068373adaf76c83024582999ed940ab16 (diff)
SL-17736: PBR: Add irradiance hack to have more even lighting and not lose details
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index c5b27ec52c..3b1003f83b 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -25,6 +25,8 @@
#define PBR_USE_GGX_APPROX 1
#define PBR_USE_GGX_EMS_HACK 1
+#define PBR_USE_IRRADIANCE_HACK 1
+
#define DEBUG_PBR_PACKORM0 0 // Rough=0, Metal=0
#define DEBUG_PBR_PACKORM1 0 // Rough=1, Metal=1
@@ -294,6 +296,9 @@ void main()
vec3 debug_irradiance = irradiance;
#endif
irradiance = max(amblit,irradiance);
+#if PBR_USE_IRRADIANCE_HACK
+ irradiance += amblit*0.5*vec3(dot(n, light_dir));
+#endif
specLight = srgb_to_linear(specLight);
#if HAS_IBL
kSpec = mix( kSpec, iridescenceFresnel, iridescenceFactor);