From c12712aa9609325ba3247a67354e91e9342106d6 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Thu, 25 May 2023 13:09:03 -0500 Subject: DRTVWR-559 Fix for off-color fullbright alpha blinn-phong materials. Scrub some NaNs. --- indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl | 2 +- indra/newview/app_settings/shaders/class1/environment/srgbF.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1') diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl index ee425f97fc..c8afacf9bb 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl @@ -47,6 +47,6 @@ void main() tc.y -= 0.1; // HACK - nudge exposure sample down a little bit to favor ground over sky vec3 c = texture(diffuseRect, tc).rgb + texture(emissiveRect, tc).rgb; float L = lum(c); - frag_color = vec4(L); + frag_color = vec4(max(L, 0.0)); } diff --git a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl index 689c345b2c..7111a822c8 100644 --- a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl @@ -124,7 +124,7 @@ vec3 legacy_adjust(vec3 c) vec3 legacy_adjust_fullbright(vec3 c) { - float exp_scale = texture(exposureMap, vec2(0.5, 0.5)).r; + float exp_scale = clamp(texture(exposureMap, vec2(0.5, 0.5)).r, 0.01, 10.0); return c / exp_scale * 1.34; //magic 1.34 arrived at by binary search for a value that reproduces midpoint grey consistenty } -- cgit v1.2.3