From 00d56e2607a671b9478bf06b7df808b2f4141395 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 10:42:39 -0700 Subject: DRTVWR-592: Disable (but do not remove) shader debug --- .../shaders/class1/deferred/pbrterrainF.glsl | 9 ++++++--- .../shaders/class1/deferred/pbrterrainUtilF.glsl | 16 +++------------- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1') diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl index 7b5eba14b7..f788b46aa7 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl @@ -82,7 +82,7 @@ vec4 sample_and_mix_color4(float alpha1, float alpha2, float alphaFinal, Terrain vec3 sample_and_mix_vector3(float alpha1, float alpha2, float alphaFinal, TerrainCoord texcoord, vec3[4] factors, sampler2D tex0, sampler2D tex1, sampler2D tex2, sampler2D tex3); vec3 sample_and_mix_normal(float alpha1, float alpha2, float alphaFinal, TerrainCoord texcoord, sampler2D tex0, sampler2D tex1, sampler2D tex2, sampler2D tex3); -#if 1 // TODO: Remove +#if 0 // TODO: Remove #define TERRAIN_DEBUG 1 // TODO: Remove debug struct TerrainMix { @@ -147,6 +147,7 @@ void main() tnorm *= gl_FrontFacing ? 1.0 : -1.0; +#if TERRAIN_DEBUG // TODO: Remove #if 0 // TODO: Remove (terrain weights visualization) TerrainMix tm = _t_mix(alpha1, alpha2, alphaFinal); #if 1 @@ -187,10 +188,12 @@ void main() //col.rgb = vec3(0.0, 1.0, 0.0); //col.rgb = spec.rgb; //col.rgb = (vNt + 1.0) / 2.0; - col.rgb = (tnorm + 1.0) / 2.0; - spec.rgb = vec3(1.0, 1.0, 0.0); + //col.rgb = (tnorm + 1.0) / 2.0; + //spec.rgb = vec3(1.0, 1.0, 0.0); + col.rgb = spec.rgb; tnorm = vary_normal; emissive = vec3(0); +#endif #endif frag_data[0] = max(vec4(col.xyz, 0.0), vec4(0)); // Diffuse frag_data[1] = max(vec4(spec.rgb, base_color_factor_alpha), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal. diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl index 13f3934689..9d1990bd4a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl @@ -57,7 +57,9 @@ vec3 srgb_to_linear(vec3 c); #define MIX_Z 1 << 1 #define MIX_W 1 << 0 -#define TERRAIN_DEBUG 1 // TODO: Remove debug +#if 0 // TODO: Remove debug +#define TERRAIN_DEBUG 1 +#endif struct TerrainMix { vec4 weight; @@ -105,18 +107,6 @@ float terrain_mix(vec4 samples, float alpha1, float alpha2, float alphaFinal) tm.weight.w * samples.w; } -#if 0 // TODO: Decide if still needed, and if so, use _t_mix internally for weights -vec3 terrain_mix(vec3[4] samples, float alpha1, float alpha2, float alphaFinal) -{ - return mix( mix(samples[3], samples[2], alpha2), mix(samples[1], samples[0], alpha1), alphaFinal ); -} - -vec4 terrain_mix(vec4[4] samples, float alpha1, float alpha2, float alphaFinal) -{ - return mix( mix(samples[3], samples[2], alpha2), mix(samples[1], samples[0], alpha1), alphaFinal ); -} -#endif - vec4 terrain_mix(TerrainMix tm, TerrainMixSample tms) { // Assume weights add to 1 -- cgit v1.2.3