From 1a9d1677408bb914622b6c6a97dd7eba9895e09d Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 2 Aug 2022 19:39:37 -0700 Subject: SL-17763: PBR: Fix ems calculation --- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 83fc144434..8bf44abbe3 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -306,10 +306,7 @@ void main() // Reference: getIBLRadianceLambertian vec3 FssEssLambert = specWeight * kSpec * vScaleBias.x + vScaleBias.y; // NOTE: Very similar to FssEssRadiance but with extra specWeight term - float Ems = (1.0 - vScaleBias.x + vScaleBias.y); -#if PBR_USE_GGX_EMS_HACK - Ems = alphaRough; // With GGX approximation Ems = 0 so use substitute -#endif + float Ems = 1.0 - (vScaleBias.x + vScaleBias.y); vec3 avg = specWeight * (reflect0 + (1.0 - reflect0) / 21.0); vec3 AvgEms = avg * Ems; vec3 FmsEms = AvgEms * FssEssLambert / (1.0 - AvgEms); -- cgit v1.2.3 From bbe2d43b7d0e64a8137075ce1390722507354538 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 2 Aug 2022 19:41:15 -0700 Subject: SL-17763: PBR: Add more BRDF debug outputs --- .../app_settings/shaders/class3/deferred/softenLightF.glsl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 8bf44abbe3..c2a3e472d0 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -55,6 +55,8 @@ #define DEBUG_PBR_DOT_NV 0 // Output: grayscale dot(Normal ,Vertex2Camera) #define DEBUG_PBR_BRDF_UV 0 // Output: red green BRDF UV (GGX input) #define DEBUG_PBR_BRDF_SCALE_BIAS 0 // Output: red green BRDF Scale Bias (GGX output) +#define DEBUG_PBR_BRDF_SCALE_ONLY 0 // Output: grayscale BRDF Scale +#define DEBUG_PBR_BRDF_BIAS_ONLY 0 // Output: grayscale BRDER Bias #define DEBUG_PBR_FRESNEL 0 // Output: roughness dependent fresnel #define DEBUG_PBR_KSPEC 0 // Output: K spec #define DEBUG_PBR_REFLECTION_DIR 0 // Output: reflection dir @@ -67,7 +69,7 @@ #define DEBUG_PBR_IRRADIANCE_RAW 0 // Output: Diffuse Irradiance pre-mix #define DEBUG_PBR_IRRADIANCE 0 // Output: Diffuse Irradiance #define DEBUG_PBR_FSS_ESS_LAMBERT 0 // Output: FssEssLambert -#define DEBUG_PBR_EMS 0 // Output: Ems +#define DEBUG_PBR_EMS 0 // Output: Ems = (1 - BRDF Scale + BRDF Bias) #define DEBUG_PBR_AVG 0 // Output: Avg #define DEBUG_PBR_FMS_EMS 0 // Output: FmsEms #define DEBUG_PBR_DIFFUSE_K 0 // Output: diffuse FssEssLambert + FmsEms @@ -387,6 +389,12 @@ void main() #if DEBUG_PBR_DIFFUSE_C color.rgb = c_diff; #endif + #if DEBUG_PBR_BRDF_SCALE_ONLY + color.rgb = vec3(vScaleBias.x); + #endif + #if DEBUG_PBR_BRDF_BIAS_ONLY + color.rgb = vec3(vScaleBias.y); + #endif #if DEBUG_PBR_DIFFUSE_K color.rgb = kDiffuse; #endif -- cgit v1.2.3