2018-05-21 11:08:02 +00:00
|
|
|
#version 110
|
|
|
|
|
|
|
|
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
|
|
|
|
2019-04-12 09:01:53 +00:00
|
|
|
varying vec3 clipping_planes_dots;
|
|
|
|
|
2018-05-21 11:08:02 +00:00
|
|
|
// x = tainted, y = specular;
|
|
|
|
varying vec2 intensity;
|
|
|
|
|
|
|
|
varying vec3 delta_box_min;
|
|
|
|
varying vec3 delta_box_max;
|
|
|
|
|
|
|
|
uniform vec4 uniform_color;
|
|
|
|
|
2019-03-25 11:01:02 +00:00
|
|
|
|
2018-05-21 11:08:02 +00:00
|
|
|
void main()
|
|
|
|
{
|
2019-04-12 09:01:53 +00:00
|
|
|
if (any(lessThan(clipping_planes_dots, ZERO)))
|
2019-03-25 11:01:02 +00:00
|
|
|
discard;
|
2018-05-21 11:08:02 +00:00
|
|
|
// 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);
|
|
|
|
}
|