Out of bed detection - New colors for out of bed state
This commit is contained in:
parent
6298a28494
commit
f99aaa1191
2 changed files with 7 additions and 8 deletions
|
@ -1823,6 +1823,7 @@ sub _fragment_shader_Gouraud {
|
||||||
return <<'FRAGMENT';
|
return <<'FRAGMENT';
|
||||||
#version 110
|
#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);
|
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
|
||||||
|
|
||||||
// x = tainted, y = specular;
|
// x = tainted, y = specular;
|
||||||
|
@ -1835,13 +1836,11 @@ uniform vec4 uniform_color;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_FragColor = vec4(intensity.y, intensity.y, intensity.y, 0.0) + uniform_color * intensity.x;
|
// 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;
|
||||||
|
|
||||||
// if the fragment is outside the print volume darken it and set it as transparent
|
gl_FragColor = vec4(intensity.y, intensity.y, intensity.y, 0.0) + color * intensity.x;
|
||||||
if (any(lessThan(delta_box_min, ZERO)) || any(greaterThan(delta_box_max, ZERO)))
|
gl_FragColor.a = color.a;
|
||||||
gl_FragColor = vec4(mix(gl_FragColor.xyz, ZERO, 0.5), 0.5 * uniform_color.a);
|
|
||||||
else
|
|
||||||
gl_FragColor.a = uniform_color.a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FRAGMENT
|
FRAGMENT
|
||||||
|
|
|
@ -194,8 +194,8 @@ void GLIndexedVertexArray::render(
|
||||||
|
|
||||||
const float GLVolume::SELECTED_COLOR[4] = { 0.0f, 1.0f, 0.0f, 1.0f };
|
const float GLVolume::SELECTED_COLOR[4] = { 0.0f, 1.0f, 0.0f, 1.0f };
|
||||||
const float GLVolume::HOVER_COLOR[4] = { 0.4f, 0.9f, 0.1f, 1.0f };
|
const float GLVolume::HOVER_COLOR[4] = { 0.4f, 0.9f, 0.1f, 1.0f };
|
||||||
const float GLVolume::OUTSIDE_COLOR[4] = { 0.75f, 0.0f, 0.75f, 1.0f };
|
const float GLVolume::OUTSIDE_COLOR[4] = { 0.0f, 0.38f, 0.8f, 1.0f };
|
||||||
const float GLVolume::SELECTED_OUTSIDE_COLOR[4] = { 1.0f, 0.0f, 1.0f, 1.0f };
|
const float GLVolume::SELECTED_OUTSIDE_COLOR[4] = { 0.19f, 0.58f, 1.0f, 1.0f };
|
||||||
|
|
||||||
void GLVolume::set_render_color(float r, float g, float b, float a)
|
void GLVolume::set_render_color(float r, float g, float b, float a)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue