From a3fc49ee76673ddcc9650baffc6a95c2f02ce144 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 12 Apr 2018 13:54:26 +0200 Subject: [PATCH] Fixed hovering not shown on out of print bed objects --- lib/Slic3r/GUI/3DScene.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm index a89ed0888..e5990fe8d 100644 --- a/lib/Slic3r/GUI/3DScene.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -1828,7 +1828,6 @@ sub _fragment_shader_Gouraud { return <<'FRAGMENT'; #version 110 -const vec4 OUTSIDE_COLOR = vec4(0.24, 0.42, 0.62, 1.0); const vec3 ZERO = vec3(0.0, 0.0, 0.0); // x = tainted, y = specular; @@ -1841,11 +1840,9 @@ uniform vec4 uniform_color; void main() { - // if the fragment is outside the print volume use predefined color - vec4 color = (any(lessThan(delta_box_min, ZERO)) || any(greaterThan(delta_box_max, ZERO))) ? OUTSIDE_COLOR : uniform_color; - - gl_FragColor = vec4(intensity.y, intensity.y, intensity.y, 0.0) + color * intensity.x; - gl_FragColor.a = color.a; + // if the fragment is outside the print volume -> use darker color + vec3 color = (any(lessThan(delta_box_min, ZERO)) || any(greaterThan(delta_box_max, ZERO))) ? mix(uniform_color.rgb, ZERO, 0.3333) : uniform_color.rgb; + gl_FragColor = vec4(vec3(intensity.y, intensity.y, intensity.y) + color * intensity.x, uniform_color.a); } FRAGMENT