diff options
author | Dave Houlton <euclid@lindenlab.com> | 2020-03-18 16:30:20 -0600 |
---|---|---|
committer | Dave Houlton <euclid@lindenlab.com> | 2020-03-18 17:30:41 -0600 |
commit | ff683a7127d299694a8fece5772f3656d9214edc (patch) | |
tree | aae1e2d3b492ab7d8e8ada4f9693f05f96e0209f /indra/newview/app_settings/shaders/class1 | |
parent | eb45c05466530c56ed9f0d4ce672bcf6dad94abf (diff) |
SL-12865, add bias to alpha mask values to avoid 8-bit acne
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index f1b13c8825..4198053c99 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -230,7 +230,10 @@ void main() vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a); #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) - if (diffuse_linear.a < minimum_alpha) + + // Comparing floats cast from 8-bit values, produces acne right at the 8-bit transition points + float bias = 0.001953125; // 1/512, or half an 8-bit quantization + if (diffuse_linear.a < minimum_alpha-bias) { discard; } |