diff options
author | Tim Kuipers <t.kuipers@ultimaker.com> | 2020-02-27 22:03:35 +0300 |
---|---|---|
committer | Tim Kuipers <t.kuipers@ultimaker.com> | 2020-02-27 22:03:35 +0300 |
commit | 890b6dc0b4243d41892c676e82b63ba18cc2256c (patch) | |
tree | 4ab768996a0b131dbbf4f08443df2a349391ae49 /plugins/SolidView | |
parent | 5d90fd31d9828ab430b70cb3183b534b34c50d17 (diff) |
prevent false negative xray error for high overlap count
Diffstat (limited to 'plugins/SolidView')
-rw-r--r-- | plugins/SolidView/xray_composite.shader | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/SolidView/xray_composite.shader b/plugins/SolidView/xray_composite.shader index c67e3392f3..6eccc2d4e5 100644 --- a/plugins/SolidView/xray_composite.shader +++ b/plugins/SolidView/xray_composite.shader @@ -53,7 +53,7 @@ fragment = float intersection_count = texture2D(u_layer2, v_uvs).r * 51; // (1 / .02) + 1 (+1 magically fixes issues with high intersection count models) float rest = mod(intersection_count + .01, 2.0); - if (rest > 1.0 && rest < 1.5) + if (rest > 1.0 && rest < 1.5 && intersection_count < 49) { vec2 scaling = textureSize(u_layer0, 0) / textureSize(u_xray_error, 0); result = result * (1.0 - u_xray_error_strength) + u_xray_error_strength * texture(u_xray_error, v_uvs * scaling); @@ -129,7 +129,7 @@ fragment41core = float intersection_count = texture(u_layer2, v_uvs).r * 51; // (1 / .02) + 1 (+1 magically fixes issues with high intersection count models) float rest = mod(intersection_count + .01, 2.0); - if (rest > 1.0 && rest < 1.5) + if (rest > 1.0 && rest < 1.5 && intersection_count < 49) { vec2 scaling = textureSize(u_layer0, 0) / textureSize(u_xray_error, 0); result = result * (1.0 - u_xray_error_strength) + u_xray_error_strength * texture(u_xray_error, v_uvs * scaling); |