diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2022-07-21 19:28:17 -0700 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2022-08-02 09:44:44 -0700 |
commit | 2bdb97613b1c1ac76c6c1eed7038e390d80594bd (patch) | |
tree | adfbe0bd7bcb19cd6060951025487846c4fd7657 | |
parent | eec96559d41fd74a4fa1137336941a6c20036eba (diff) |
SL-17762: PBR: Add debug flag to turn off regular output and color code point lights and spot lights
6 files changed, 35 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl index 5072f16988..e6f2c9d02b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl @@ -25,6 +25,8 @@ /*[EXTRA_CODE_HERE]*/ +#define DEBUG_PBR_LIGHT_TYPE 0 // Output Diffuse=0.75, Emissive=0, ORM=0,0,0 + #define DEBUG_BASIC 0 #define DEBUG_VERTEX 0 #define DEBUG_NORMAL_MAP 0 // Output packed normal map "as is" to diffuse @@ -120,7 +122,11 @@ void main() emissive *= texture2D(emissiveMap, vary_texcoord0.xy).rgb; #endif - +#if DEBUG_PBR_LIGHT_TYPE + col.rgb = vec3(0.75); + emissive = vec3(0); + spec.rgb = vec3(0); +#endif #if DEBUG_BASIC col.rgb = vec3( 1, 0, 1 ); #endif 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 @@ -478,6 +479,9 @@ void main() #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 } else 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 |