ENABLE_SLOPE_RENDERING set as default

Slope rendering active only when using Gizmo FDM supports
This commit is contained in:
enricoturri1966 2020-10-02 15:43:39 +02:00
parent 38ddc5fdc4
commit 0f44caa99c
14 changed files with 30 additions and 221 deletions

View file

@ -9,8 +9,7 @@ const float EPSILON = 0.0001;
struct SlopeDetection
{
bool actived;
// x = yellow, y = red
vec2 z_range;
float normal_z;
mat3 volume_world_normal_matrix;
};
@ -33,8 +32,7 @@ varying vec3 eye_normal;
vec3 slope_color()
{
float gradient_range = slope.z_range.x - slope.z_range.y;
return (world_normal_z > slope.z_range.x - EPSILON) ? GREEN : ((gradient_range == 0.0) ? RED : mix(RED, YELLOW, clamp((world_normal_z - slope.z_range.y) / gradient_range, 0.0, 1.0)));
return (world_normal_z > slope.normal_z - EPSILON) ? GREEN : RED;
}
void main()

View file

@ -29,8 +29,7 @@ struct PrintBoxDetection
struct SlopeDetection
{
bool actived;
// x = yellow, y = red
vec2 z_range;
float normal_z;
mat3 volume_world_normal_matrix;
};