From f1ccd38258f63d7f9a04296cab8309f935de9951 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Tue, 31 Mar 2020 12:51:50 +0200 Subject: [PATCH] Fixed shaders on Intel Cards - not allowed use of 'active' word --- resources/shaders/gouraud.fs | 4 ++-- resources/shaders/gouraud.vs | 8 ++++---- src/slic3r/GUI/3DScene.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/shaders/gouraud.fs b/resources/shaders/gouraud.fs index dce033d7b..853a5512c 100644 --- a/resources/shaders/gouraud.fs +++ b/resources/shaders/gouraud.fs @@ -8,7 +8,7 @@ const float EPSILON = 0.0001; struct SlopeDetection { - bool active; + bool actived; // x = yellow, y = red vec2 z_range; mat3 volume_world_normal_matrix; @@ -37,7 +37,7 @@ void main() { if (any(lessThan(clipping_planes_dots, ZERO))) discard; - vec3 color = slope.active ? slope_color() : uniform_color.rgb; + vec3 color = slope.actived ? slope_color() : uniform_color.rgb; // if the fragment is outside the print volume -> use darker color color = (any(lessThan(delta_box_min, ZERO)) || any(greaterThan(delta_box_max, ZERO))) ? mix(color, ZERO, 0.3333) : color; gl_FragColor = vec4(vec3(intensity.y, intensity.y, intensity.y) + color * intensity.x, uniform_color.a); diff --git a/resources/shaders/gouraud.vs b/resources/shaders/gouraud.vs index 72d6c18b3..a9f3f6118 100644 --- a/resources/shaders/gouraud.vs +++ b/resources/shaders/gouraud.vs @@ -20,7 +20,7 @@ const vec3 ZERO = vec3(0.0, 0.0, 0.0); struct PrintBoxDetection { - bool active; + bool actived; vec3 min; vec3 max; mat4 volume_world_matrix; @@ -28,7 +28,7 @@ struct PrintBoxDetection struct SlopeDetection { - bool active; + bool actived; // x = yellow, y = red vec2 z_range; mat3 volume_world_normal_matrix; @@ -72,7 +72,7 @@ void main() intensity.x += NdotL * LIGHT_FRONT_DIFFUSE; // compute deltas for out of print volume detection (world coordinates) - if (print_box.active) + if (print_box.actived) { vec3 v = (print_box.volume_world_matrix * gl_Vertex).xyz; delta_box_min = v - print_box.min; @@ -85,7 +85,7 @@ void main() } // z component of normal vector in world coordinate used for slope shading - world_normal_z = slope.active ? (normalize(slope.volume_world_normal_matrix * gl_Normal)).z : 0.0; + world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * gl_Normal)).z : 0.0; gl_Position = ftransform(); // Point in homogenous coordinates. diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index c13c1b937..e60676ca3 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -655,11 +655,11 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab GLint print_box_min_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.min") : -1; GLint print_box_max_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.max") : -1; - GLint print_box_active_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.active") : -1; + GLint print_box_active_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.actived") : -1; GLint print_box_worldmatrix_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.volume_world_matrix") : -1; #if ENABLE_SLOPE_RENDERING - GLint slope_active_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "slope.active") : -1; + GLint slope_active_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "slope.actived") : -1; GLint slope_normal_matrix_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "slope.volume_world_normal_matrix") : -1; GLint slope_z_range_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "slope.z_range") : -1; #endif // ENABLE_SLOPE_RENDERING