diff options
author | Dave Parks <davep@lindenlab.com> | 2023-04-06 13:21:25 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-04-06 13:21:25 -0500 |
commit | bb79718c8f0050569c80a1bfe4dd428321706d1a (patch) | |
tree | 7cf588c843e8a9e17629b77bb4903c97a3f346fd /indra/newview/app_settings | |
parent | 31f8fb79513ba6d1220aac13a5db110a7e4104da (diff) |
SL-19538 Followup -- scrub all possible sources of NaNs, make dynamic exposure controls not persist, limit exposure range, and do a debug gl pass.
Diffstat (limited to 'indra/newview/app_settings')
47 files changed, 70 insertions, 101 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 44a86dd22a..7d15214ccb 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10452,7 +10452,7 @@ <key>Comment</key> <string>Amount to over-brighten sun for HDR effect during the day</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>F32</string> <key>Value</key> @@ -10463,7 +10463,7 @@ <key>Comment</key> <string>Maximum effective probe ambiance for local lights</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>F32</string> <key>Value</key> @@ -10474,7 +10474,7 @@ <key>Comment</key> <string>Minimum dynamic exposure amount</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>F32</string> <key>Value</key> @@ -10485,7 +10485,7 @@ <key>Comment</key> <string>Maximum dynamic exposure amount</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>F32</string> <key>Value</key> @@ -10496,7 +10496,7 @@ <key>Comment</key> <string>Luminance coefficient for dynamic exposure</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>F32</string> <key>Value</key> diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index 93a85cad40..cc79b450ac 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -115,7 +115,7 @@ void main() col /= defined_weight.xyxx; //col.y *= col.y; - frag_color = col; + frag_color = max(col, vec4(0)); #ifdef IS_AMD_CARD // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl index 749ec3a6ac..c18bca066d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform float minimum_alpha; uniform sampler2D diffuseMap; @@ -65,4 +61,5 @@ void main() //frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested vec3 nvn = normalize(tnorm); frag_data[2] = vec4(encode_normal(nvn), vertex_color.a, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl index 4bf16b50bf..aa61e10c7f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl @@ -531,7 +531,7 @@ vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor, specContrib *= NdotL; specContrib = max(specContrib, vec3(0)); - return color; + return clamp(color, vec3(0), vec3(10)); } vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor, diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl index 3bf148502c..afc05b8bb5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform float minimum_alpha; @@ -54,5 +50,6 @@ void main() frag_data[1] = vec4(0,0,0,0); // spec vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl index e15239b59d..078197f9a8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; VARYING vec3 vary_normal; @@ -53,4 +49,5 @@ void main() frag_data[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl index b0ff233414..307dda6b73 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform float minimum_alpha; @@ -53,5 +49,6 @@ void main() frag_data[1] = vec4(0,0,0,0); // spec vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index b2d2e2fa71..24e290c614 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform sampler2D diffuseMap; @@ -47,5 +43,6 @@ void main() //frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), vertex_color.a, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl index b4bc114dd5..be870b2424 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; VARYING vec3 vary_normal; VARYING vec4 vertex_color; @@ -49,4 +45,5 @@ void main() frag_data[1] = vec4(spec, vertex_color.a); // spec vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), vertex_color.a, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl index fb97cd95b4..17e24a2bf2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl @@ -41,6 +41,6 @@ void main() vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl index 3eda2b9050..7ed8e4c8ce 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl @@ -55,6 +55,6 @@ void main() s = mix(prev, s, min(dt*2.0*abs(prev-s), 0.04)); - frag_color = vec4(s, s, s, dt); + frag_color = max(vec4(s, s, s, dt), vec4(0.0)); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 03df9fd4a1..b5eae3a1d5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -92,7 +92,6 @@ void main() #endif - frag_color.rgb = color.rgb; - frag_color.a = color.a; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl index 75f914cb02..74df43b7c3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl @@ -23,11 +23,7 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform vec4 color; uniform sampler2D diffuseMap; @@ -39,4 +35,5 @@ void main() frag_data[0] = color*texture2D(diffuseMap, vary_texcoord0.xy); frag_data[1] = vec4(0.0); frag_data[2] = vec4(0.0, 1.0, 0.0, GBUFFER_FLAG_SKIP_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 51afda2791..5e67442b3a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform float minimum_alpha; @@ -58,4 +54,5 @@ void main() frag_data[0] = vec4(col.rgb, 0.0); frag_data[1] = spec; frag_data[2] = vec4(encode_normal(norm.xyz),0,GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 4b98e6708f..4dee23372f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -32,7 +32,7 @@ #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) out vec4 frag_color; #else -out vec4 frag_data[3]; +out vec4 frag_data[4]; #endif void main() @@ -44,6 +44,7 @@ void main() frag_data[0] = vec4(0.5, 0, 1, 0); // gbuffer is sRGB for legacy materials frag_data[1] = vec4(0); // XYZ = Specular color. W = Specular exponent. frag_data[2] = vec4(0); // XY = Normal. Z = Env. intensity. W = 1 skip atmos (mask off fog) + frag_data[3] = vec4(0); #endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl index 6659e67a7a..8e5a6c90e0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl @@ -101,10 +101,10 @@ void main() //emissive = vNt * 0.5 + 0.5; //emissive = tnorm*0.5+0.5; // See: C++: addDeferredAttachments(), GLSL: softenLightF - frag_data[0] = vec4(col, 0.0); // Diffuse - frag_data[1] = vec4(spec.rgb,vertex_color.a); // PBR linear packed Occlusion, Roughness, Metal. - frag_data[2] = vec4(encode_normal(tnorm), vertex_color.a, GBUFFER_FLAG_HAS_PBR); // normal, environment intensity, flags - frag_data[3] = vec4(emissive,0); // PBR sRGB Emissive + frag_data[0] = max(vec4(col, 0.0), vec4(0)); // Diffuse + frag_data[1] = max(vec4(spec.rgb,vertex_color.a), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal. + frag_data[2] = max(vec4(encode_normal(tnorm), vertex_color.a, GBUFFER_FLAG_HAS_PBR), vec4(0)); // normal, environment intensity, flags + frag_data[3] = max(vec4(emissive,0), vec4(0)); // PBR sRGB Emissive } #else diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index bdbc0056f8..3cfad5498b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -190,10 +190,7 @@ void main() vec3 seed = (diff.rgb+vec3(1.0))*vec3(tc.xy, tc.x+tc.y); vec3 nz = vec3(noise(seed.rg), noise(seed.gb), noise(seed.rb)); diff.rgb += nz*0.003; - //diff.rgb = nz; - - //float exp_sample = texture(exposureMap, vec2(0.5,0.5)).r; - //diff.g = exp_sample; - frag_color = diff; + + frag_color = max(diff, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl index d6c14c48c9..3464212c84 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform sampler2D detail_0; uniform sampler2D detail_1; @@ -64,5 +60,6 @@ void main() frag_data[1] = vec4(0.0,0.0,0.0,-1.0); vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl index dc0e5b0ce3..d857e47b90 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform sampler2D diffuseMap; @@ -53,4 +49,5 @@ void main() frag_data[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(0); } diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl index c1f6af9f57..301e8aba26 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl @@ -56,5 +56,5 @@ void main() col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw); col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw); - frag_color = vec4(col.rgb * glowStrength, col.a); + frag_color = max(vec4(col.rgb * glowStrength, col.a), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index f520f301d9..69c1983b4d 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -44,5 +44,5 @@ void main() discard; } - frag_color = col; + frag_color = max(col, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/interface/clipF.glsl b/indra/newview/app_settings/shaders/class1/interface/clipF.glsl index ac2bc8703b..9454bbf21e 100644 --- a/indra/newview/app_settings/shaders/class1/interface/clipF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/clipF.glsl @@ -42,5 +42,5 @@ void main() discard; } - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl index 67c6baddbb..cb8d6a8c03 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -33,5 +33,5 @@ uniform vec4 color; void main() { - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl b/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl index 188fac5460..eca591d387 100644 --- a/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl @@ -49,5 +49,5 @@ void main() col += texture(diffuseRect, tc).rgb * w[i]; } - frag_color = vec4(col, 0.0); + frag_color = max(vec4(col, 0.0), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index 6cc9bbbea2..58c9e5ad0a 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -36,5 +36,5 @@ VARYING vec2 vary_texcoord0; void main() { - frag_color = color*texture2D(diffuseMap, vary_texcoord0.xy); + frag_color = max(color*texture2D(diffuseMap, vary_texcoord0.xy), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl index a1839d4a67..cd5d97c785 100644 --- a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl @@ -162,6 +162,6 @@ vec4 prefilterEnvMap(vec3 R) void main() { vec3 N = normalize(vary_dir); - frag_color = prefilterEnvMap(N); + frag_color = max(prefilterEnvMap(N), vec4(0)); } // ============================================================================================================= diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl index b2c83a0f44..eaf0f71b41 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl @@ -51,6 +51,6 @@ void default_lighting() color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl index d87403c78f..fc76c0cc00 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl @@ -54,6 +54,6 @@ void default_lighting() color.rgb = scaleSoftClip(color.rgb); - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl index 9fd189358b..6b86d717da 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl @@ -43,6 +43,6 @@ void default_lighting() color.rgb = scaleSoftClip(color.rgb); - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl index f9c7ad2ab3..59c1bc1446 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl @@ -45,6 +45,6 @@ void default_lighting() color.rgb = scaleSoftClip(color.rgb); - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl index 9c89c09573..7da8e9054a 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl @@ -50,6 +50,6 @@ void default_lighting_water() color.rgb = atmosLighting(color.rgb); - frag_color = applyWaterFog(color); + frag_color = max(applyWaterFog(color), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl index 9de7a03180..f767c17f86 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -54,6 +54,6 @@ void default_lighting_water() color = applyWaterFog(color); - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl index 57ed993a66..2530bdcc74 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl @@ -41,6 +41,6 @@ void default_lighting_water() color.rgb = atmosLighting(color.rgb); - frag_color = applyWaterFog(color); + frag_color = max(applyWaterFog(color), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl index af5da1411b..7f112d7435 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl @@ -43,6 +43,6 @@ void default_lighting_water() color.rgb = atmosLighting(color.rgb); - frag_color = applyWaterFog(color); + frag_color = max(applyWaterFog(color), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl index d55f0db530..1deb374cd0 100644 --- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl @@ -40,5 +40,5 @@ void main() float tex0 = texture2D(texture0, vary_texcoord0.xy).a; float tex1 = texture2D(texture1, vary_texcoord1.xy).a; - frag_color = vec4(tex0+(1.0-tex1)-0.5); + frag_color = max(vec4(tex0+(1.0-tex1)-0.5), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl index add437d144..467a9949e4 100644 --- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl @@ -44,5 +44,5 @@ void main() discard; } - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/objects/previewF.glsl b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl index 284da3d0ac..687d6b7482 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl @@ -37,5 +37,5 @@ VARYING vec2 vary_texcoord0; void main() { vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl index 3a5e6fdf7c..b56fc97a85 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl @@ -38,5 +38,5 @@ VARYING vec2 vary_texcoord0; void main() { - frag_color = texture2D(diffuseMap,vary_texcoord0.xy) * color; + frag_color = max(texture2D(diffuseMap,vary_texcoord0.xy) * color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 70be9a9029..53552870ae 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -306,6 +306,6 @@ void main() color.rgb = linear_to_srgb(color.rgb); #endif - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class2/interface/irradianceGenF.glsl b/indra/newview/app_settings/shaders/class2/interface/irradianceGenF.glsl index d21af946e0..0753e73dc8 100644 --- a/indra/newview/app_settings/shaders/class2/interface/irradianceGenF.glsl +++ b/indra/newview/app_settings/shaders/class2/interface/irradianceGenF.glsl @@ -209,6 +209,6 @@ void main() color = filterColor(vary_dir); - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class2/interface/reflectionprobeF.glsl b/indra/newview/app_settings/shaders/class2/interface/reflectionprobeF.glsl index 986b233e0b..c858531998 100644 --- a/indra/newview/app_settings/shaders/class2/interface/reflectionprobeF.glsl +++ b/indra/newview/app_settings/shaders/class2/interface/reflectionprobeF.glsl @@ -38,5 +38,5 @@ void main() float depth = getDepth(tc.xy); vec4 pos = getPositionWithDepth(tc, depth); - frag_color = sampleReflectionProbesDebug(pos.xyz); + frag_color = max(sampleReflectionProbesDebug(pos.xyz), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl index f6bed16c84..6b7dc7ac1d 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl @@ -92,6 +92,6 @@ void main() color.a = 1.0; - frag_color = color; + frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl index 02ab4494f6..1aef971d3a 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl @@ -183,7 +183,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe #else #ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; +out vec4 frag_data[4]; #else #define frag_data gl_FragData #endif @@ -412,13 +412,14 @@ void main() color = temp.rgb; #endif - frag_color = vec4(color, al); + frag_color = max(vec4(color, al), vec4(0)); #else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer // deferred path // See: C++: addDeferredAttachment(), shader: softenLightF.glsl frag_data[0] = vec4(diffcol.rgb, emissive); // gbuffer is sRGB for legacy materials frag_data[1] = vec4(spec.rgb, glossiness); // XYZ = Specular color. W = Specular exponent. frag_data[2] = vec4(encode_normal(norm), env, GBUFFER_FLAG_HAS_ATMOS);; // XY = Normal. Z = Env. intensity. W = 1 skip atmos (mask off fog) + frag_data[3] = vec4(0); #endif } diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl index 742f528cb1..f1865a77e2 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl @@ -73,7 +73,7 @@ void main() vec4 diffuse = texture2D(diffuseRect, tc); vec3 specCol = spec.rgb; - frag_color = texture(diffuseMap, tc); + vec4 fcol = texture(diffuseMap, tc); if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { @@ -94,5 +94,6 @@ void main() collectedColor.rgb *= specCol.rgb; - frag_color += collectedColor * w; + fcol += collectedColor * w; + frag_color = max(fcol, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 99beb0d890..e1206cc844 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -270,6 +270,6 @@ void main() color = fogged.rgb; #endif - frag_color.rgb = color.rgb; //output linear since local lights will be added to this shader's results + frag_color.rgb = max(color.rgb, vec3(0)); //output linear since local lights will be added to this shader's results frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl index 83454631d4..21c30012ab 100644 --- a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl @@ -77,5 +77,5 @@ void main() vec4 fb = vec4(waterFogColorLinear, 0.0); #endif - frag_color = applyWaterFogViewLinearNoClip(vary_position, fb, vec3(1)); + frag_color = max(applyWaterFogViewLinearNoClip(vary_position, fb, vec3(1)), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index ec0439fa97..3d4f4fc17b 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -286,6 +286,6 @@ void main() float spec = min(max(max(punctual.r, punctual.g), punctual.b), 0.05); - frag_color = vec4(color, spec); //*sunAngle2); + frag_color = max(vec4(color, spec), vec4(0)); } |