NEW: add overhang highlight area

overhang rgb=(200,0,0),remove supportType,do not save para after overhang operation preview

Change-Id: I947bbd9db264f00f0609b3f02140060f9a2621fb
(cherry picked from commit 796c4460fe998da206f9ca77973a20796fa1d3ca)
This commit is contained in:
zhou.xu 2023-04-18 20:00:30 +08:00 committed by Lane.Wei
parent 35d6b072d3
commit 507a8a6d36
9 changed files with 84 additions and 20 deletions

View file

@ -4,6 +4,8 @@ const vec3 ZERO = vec3(0.0, 0.0, 0.0);
//BBS: add grey and orange
//const vec3 GREY = vec3(0.9, 0.9, 0.9);
const vec3 ORANGE = vec3(0.8, 0.4, 0.0);
const vec3 LightRed = vec3(0.78, 0.0, 0.0);
const vec3 LightBlue = vec3(0.73, 1.0, 1.0);
const float EPSILON = 0.0001;
struct PrintVolumeDetection
@ -58,13 +60,19 @@ void main()
vec3 color = uniform_color.rgb;
float alpha = uniform_color.a;
if (slope.actived && world_normal_z < slope.normal_z - EPSILON) {
//color = vec3(0.7, 0.7, 1.0);
color = ORANGE;
alpha = 1.0;
if (slope.actived) {
if(world_pos.z<0.1&&world_pos.z>-0.1)
{
color = LightBlue;
alpha = 0.8;
}
else if( world_normal_z < slope.normal_z - EPSILON)
{
color = color * 0.5 + LightRed * 0.5;
alpha = 0.8;
}
}
// if the fragment is outside the print volume -> use darker color
// if the fragment is outside the print volume -> use darker color
vec3 pv_check_min = ZERO;
vec3 pv_check_max = ZERO;
if (print_volume.type == 0) {
@ -85,7 +93,7 @@ void main()
if (is_outline)
gl_FragColor = uniform_color;
#ifdef ENABLE_ENVIRONMENT_MAP
else if (use_environment_tex)
else if (use_environment_tex)
gl_FragColor = vec4(0.45 * texture2D(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + 0.8 * color * intensity.x, alpha);
#endif
else

View file

@ -19,12 +19,13 @@ const float EPSILON = 0.0001;
//BBS: add grey and orange
//const vec3 GREY = vec3(0.9, 0.9, 0.9);
const vec3 ORANGE = vec3(0.8, 0.4, 0.0);
const vec3 LightRed = vec3(0.78, 0.0, 0.0);
const vec3 LightBlue = vec3(0.73, 1.0, 1.0);
uniform vec4 uniform_color;
varying vec3 clipping_planes_dots;
varying vec4 model_pos;
varying vec4 world_pos;
uniform bool volume_mirrored;
struct SlopeDetection
@ -48,10 +49,17 @@ void main()
#endif
vec3 transformed_normal = normalize(slope.volume_world_normal_matrix * triangle_normal);
if (slope.actived && transformed_normal.z < slope.normal_z - EPSILON) {
//color = vec3(0.7, 0.7, 1.0);
color = color * 0.5 + ORANGE * 0.5;
alpha = 1.0;
if (slope.actived) {
if(world_pos.z<0.1&&world_pos.z>-0.1)
{
color = LightBlue;
alpha = 1.0;
}
else if( transformed_normal.z < slope.normal_z - EPSILON)
{
color = color * 0.5 + LightRed * 0.5;
alpha = 1.0;
}
}
if (volume_mirrored)

View file

@ -10,7 +10,7 @@ uniform vec4 clipping_plane;
varying vec3 clipping_planes_dots;
varying vec4 model_pos;
varying vec4 world_pos;
struct SlopeDetection
{
bool actived;
@ -22,7 +22,7 @@ void main()
{
model_pos = gl_Vertex;
// Point in homogenous coordinates.
vec4 world_pos = volume_world_matrix * gl_Vertex;
world_pos = volume_world_matrix * gl_Vertex;
gl_Position = ftransform();
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.