From 2bdb97613b1c1ac76c6c1eed7038e390d80594bd Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 21 Jul 2022 19:28:17 -0700 Subject: SL-17762: PBR: Add debug flag to turn off regular output and color code point lights and spot lights --- .../app_settings/shaders/class3/deferred/multiPointLightF.glsl | 6 ++++++ .../app_settings/shaders/class3/deferred/multiSpotLightF.glsl | 6 ++++++ indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl | 6 ++++++ .../newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 4 ++++ indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl | 6 ++++++ 5 files changed, 28 insertions(+) (limited to 'indra/newview/app_settings/shaders/class3/deferred') diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl index 513b748f5f..521ad33059 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl @@ -27,6 +27,8 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -106,6 +108,10 @@ void main() colorSpec += intensity * nl * BRDFSpecularGGX(reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh); } } + + #if DEBUG_PBR_LIGHT_TYPE + colorDiffuse = vec3(0,0.5,0); colorSpec = vec3(0); + #endif final_color = colorDiffuse + colorSpec; } else diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index b86402b031..332cf28fb8 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -28,6 +28,8 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -202,6 +204,10 @@ void main() vec3 colorEmissive = spec.rgb; // PBR sRGB Emissive. See: pbropaqueF.glsl vec3 packedORM = texture2DRect(emissiveRect, tc).rgb; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl + #if DEBUG_PBR_LIGHT_TYPE + colorDiffuse = vec3(0.5); colorSpec = vec3(0); + #endif + final_color = colorDiffuse + colorSpec; } else diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl index 8886abb7d1..5d9b4bc877 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl @@ -27,6 +27,8 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -104,6 +106,10 @@ void main() colorSpec += intensity * nl * BRDFSpecularGGX(reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh); } +#if DEBUG_PBR_LIGHT_TYPE + colorDiffuse = vec3(0,0,0.5); colorSpec = vec3(0); +#endif + final_color = colorDiffuse + colorSpec; } else diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 59076d9760..4e92915dc2 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -27,6 +27,7 @@ #define PBR_USE_GGX_EMS_HACK 0 #define PBR_USE_IRRADIANCE_HACK 1 +#define DEBUG_PBR_LIGHT_TYPE 0 // Output no global light to make it easier to see pointLight and spotLight #define DEBUG_PBR_PACKORM0 0 // Rough=0, Metal=0 #define DEBUG_PBR_PACKORM1 0 // Rough=1, Metal=1 #define DEBUG_PBR_TANGENT1 1 // Tangent = 1,0,0 @@ -477,6 +478,9 @@ void main() #endif #if DEBUG_PBR_SUN_CONTRIB color.rgb = sun_contrib; + #endif + #if DEBUG_PBR_LIGHT_TYPE + color.rgb = vec3(0); #endif frag_color.rgb = color.rgb; // PBR is done in linear } diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index 680fcbfab3..b94db1b4cb 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -28,6 +28,8 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -191,6 +193,10 @@ void main() vec3 colorEmissive = spec.rgb; // PBR sRGB Emissive. See: pbropaqueF.glsl vec3 packedORM = texture2DRect(emissiveRect, tc).rgb; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl + #if DEBUG_PBR_LIGHT_TYPE + colorDiffuse = vec3(0.5,0,0); colorSpec = vec3(0.0); + #endif + final_color = colorDiffuse + colorSpec; } else -- cgit v1.2.3