summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/deferred
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-04-06 13:21:25 -0500
committerDave Parks <davep@lindenlab.com>2023-04-06 13:21:25 -0500
commitbb79718c8f0050569c80a1bfe4dd428321706d1a (patch)
tree7cf588c843e8a9e17629b77bb4903c97a3f346fd /indra/newview/app_settings/shaders/class3/deferred
parent31f8fb79513ba6d1220aac13a5db110a7e4104da (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/shaders/class3/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl2
4 files changed, 8 insertions, 6 deletions
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;
}