diff --git a/plugins/SimulationView/SimulationPass.py b/plugins/SimulationView/SimulationPass.py index e623be9b8d..f7f730bf61 100644 --- a/plugins/SimulationView/SimulationPass.py +++ b/plugins/SimulationView/SimulationPass.py @@ -61,6 +61,9 @@ class SimulationPass(RenderPass): self._current_shader = self._layer_shader # Use extruder 0 if the extruder manager reports extruder index -1 (for single extrusion printers) self._layer_shader.setUniformValue("u_active_extruder", float(max(0, self._extruder_manager.activeExtruderIndex))) + if not self._compatibility_mode: + self._layer_shader.setUniformValue("u_starts_color", Color(*Application.getInstance().getTheme().getColor("layerview_starts").getRgb())) + if self._layer_view: self._layer_shader.setUniformValue("u_max_feedrate", self._layer_view.getMaxFeedrate()) self._layer_shader.setUniformValue("u_min_feedrate", self._layer_view.getMinFeedrate()) diff --git a/plugins/SimulationView/layers3d.shader b/plugins/SimulationView/layers3d.shader index c9c911ecaa..0a5cc23ce7 100644 --- a/plugins/SimulationView/layers3d.shader +++ b/plugins/SimulationView/layers3d.shader @@ -111,6 +111,8 @@ geometry41core = uniform highp mat4 u_viewMatrix; uniform highp mat4 u_projectionMatrix; + uniform lowp vec4 u_starts_color; + uniform int u_show_travel_moves; uniform int u_show_helpers; uniform int u_show_skin; @@ -279,20 +281,20 @@ geometry41core = float w = v_line_dim[0].x / 2; float h = v_line_dim[0].y / 2; - myEmitVertex(v_vertex[0] + vec3( w, h, w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3( 1.0, 1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, h, w, 0.0))); // Front-top-left - myEmitVertex(v_vertex[0] + vec3(-w, h, w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3(-1.0, 1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, h, w, 0.0))); // Front-top-right - myEmitVertex(v_vertex[0] + vec3( w, -h, w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3( 1.0, -1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h, w, 0.0))); // Front-bottom-left - myEmitVertex(v_vertex[0] + vec3(-w, -h, w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3(-1.0, -1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h, w, 0.0))); // Front-bottom-right - myEmitVertex(v_vertex[0] + vec3(-w, -h, -w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3(-1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h, -w, 0.0))); // Back-bottom-right - myEmitVertex(v_vertex[0] + vec3(-w, h, w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3(-1.0, 1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, h, w, 0.0))); // Front-top-right - myEmitVertex(v_vertex[0] + vec3(-w, h, -w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3(-1.0, 1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, h, -w, 0.0))); // Back-top-right - myEmitVertex(v_vertex[0] + vec3( w, h, w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3( 1.0, 1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, h, w, 0.0))); // Front-top-left - myEmitVertex(v_vertex[0] + vec3( w, h, -w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3( 1.0, 1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, h, -w, 0.0))); // Back-top-left - myEmitVertex(v_vertex[0] + vec3( w, -h, w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3( 1.0, -1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h, w, 0.0))); // Front-bottom-left - myEmitVertex(v_vertex[0] + vec3( w, -h, -w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3( 1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h, -w, 0.0))); // Back-bottom-left - myEmitVertex(v_vertex[0] + vec3(-w, -h, -w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3(-1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h, -w, 0.0))); // Back-bottom-right - myEmitVertex(v_vertex[0] + vec3( w, h, -w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3( 1.0, 1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, h, -w, 0.0))); // Back-top-left - myEmitVertex(v_vertex[0] + vec3(-w, h, -w), vec4(1.0, 1.0, 1.0, 1.0), normalize(vec3(-1.0, 1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, h, -w, 0.0))); // Back-top-right + myEmitVertex(v_vertex[0] + vec3( w, h, w), u_starts_color, normalize(vec3( 1.0, 1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, h, w, 0.0))); // Front-top-left + myEmitVertex(v_vertex[0] + vec3(-w, h, w), u_starts_color, normalize(vec3(-1.0, 1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, h, w, 0.0))); // Front-top-right + myEmitVertex(v_vertex[0] + vec3( w, -h, w), u_starts_color, normalize(vec3( 1.0, -1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h, w, 0.0))); // Front-bottom-left + myEmitVertex(v_vertex[0] + vec3(-w, -h, w), u_starts_color, normalize(vec3(-1.0, -1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h, w, 0.0))); // Front-bottom-right + myEmitVertex(v_vertex[0] + vec3(-w, -h, -w), u_starts_color, normalize(vec3(-1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h, -w, 0.0))); // Back-bottom-right + myEmitVertex(v_vertex[0] + vec3(-w, h, w), u_starts_color, normalize(vec3(-1.0, 1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, h, w, 0.0))); // Front-top-right + myEmitVertex(v_vertex[0] + vec3(-w, h, -w), u_starts_color, normalize(vec3(-1.0, 1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, h, -w, 0.0))); // Back-top-right + myEmitVertex(v_vertex[0] + vec3( w, h, w), u_starts_color, normalize(vec3( 1.0, 1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, h, w, 0.0))); // Front-top-left + myEmitVertex(v_vertex[0] + vec3( w, h, -w), u_starts_color, normalize(vec3( 1.0, 1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, h, -w, 0.0))); // Back-top-left + myEmitVertex(v_vertex[0] + vec3( w, -h, w), u_starts_color, normalize(vec3( 1.0, -1.0, 1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h, w, 0.0))); // Front-bottom-left + myEmitVertex(v_vertex[0] + vec3( w, -h, -w), u_starts_color, normalize(vec3( 1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, -h, -w, 0.0))); // Back-bottom-left + myEmitVertex(v_vertex[0] + vec3(-w, -h, -w), u_starts_color, normalize(vec3(-1.0, -1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, -h, -w, 0.0))); // Back-bottom-right + myEmitVertex(v_vertex[0] + vec3( w, h, -w), u_starts_color, normalize(vec3( 1.0, 1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4( w, h, -w, 0.0))); // Back-top-left + myEmitVertex(v_vertex[0] + vec3(-w, h, -w), u_starts_color, normalize(vec3(-1.0, 1.0, -1.0)), viewProjectionMatrix * (gl_in[0].gl_Position + vec4(-w, h, -w, 0.0))); // Back-top-right EndPrimitive(); } @@ -340,6 +342,8 @@ u_diffuseColor = [1.0, 0.79, 0.14, 1.0] u_minimumAlbedo = [0.1, 0.1, 0.1, 1.0] u_shininess = 20.0 +u_starts_color = [1.0, 1.0, 1.0, 1.0] + u_show_travel_moves = 0 u_show_helpers = 1 u_show_skin = 1 diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 05a7109361..d0ae589d62 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -389,6 +389,7 @@ "layerview_support_interface": [63, 127, 255, 127], "layerview_prime_tower": [0, 255, 255, 255], "layerview_nozzle": [181, 166, 66, 50], + "layerview_starts": [255, 255, 255, 255], "tab_status_connected": [50, 130, 255, 255], "tab_status_disconnected": [200, 200, 200, 255],