Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Kuipers <t.kuipers@ultimaker.com>2020-02-27 20:17:07 +0300
committerTim Kuipers <t.kuipers@ultimaker.com>2020-02-27 20:17:07 +0300
commitb51b6997155b7d074e0e8112b3afedac13ba5d94 (patch)
treee96843a579194f50153e26808db046ca766a8bbe /plugins/XRayView
parent0e633a0dfaa202e4b95720d99428a5f4c790301a (diff)
fix old xray view
I don't understand why it only seems to work if I define u_color via [default] andd why it doesn't work when I set it inside the shader itself.
Diffstat (limited to 'plugins/XRayView')
-rw-r--r--plugins/XRayView/xray_composite.shader10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/XRayView/xray_composite.shader b/plugins/XRayView/xray_composite.shader
index 8e21bf00c8..51e1cf326f 100644
--- a/plugins/XRayView/xray_composite.shader
+++ b/plugins/XRayView/xray_composite.shader
@@ -50,8 +50,9 @@ fragment =
result = layer0 * layer0.a + result * (1.0 - layer0.a);
- float intersection_count = texture2D(u_layer2, v_uvs).r * 255.0;
- if(mod(intersection_count, 2.0) >= 1.0)
+ float intersection_count = texture2D(u_layer2, v_uvs).r * 50; // 1 / .02
+ float rest = mod(intersection_count, 2.0);
+ if (rest > 0.5 && rest < 1.5)
{
result = u_error_color;
}
@@ -121,8 +122,9 @@ fragment41core =
result = layer0 * layer0.a + result * (1.0 - layer0.a);
- float intersection_count = texture(u_layer2, v_uvs).r * 255.0;
- if(mod(intersection_count, 2.0) >= 1.0)
+ float intersection_count = texture(u_layer2, v_uvs).r * 50; // 1 / .02
+ float rest = mod(intersection_count, 2.0);
+ if (rest > 0.5 && rest < 1.5)
{
result = u_error_color;
}