mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 22:13:58 -06:00
Remove superfluous grid shader
The grid shader is now exactly equal to the colour shader, so let's just use the colour shader. Contributes to issue CURA-4150.
This commit is contained in:
parent
bb3f8d085b
commit
585b6ad8eb
2 changed files with 6 additions and 64 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
@ -60,7 +60,7 @@ class BuildVolume(SceneNode):
|
|||
|
||||
self._plate_mesh = None
|
||||
self._grid_mesh = None
|
||||
self._grid_shader = None
|
||||
self._plate_shader = None
|
||||
|
||||
self._disallowed_areas = []
|
||||
self._disallowed_area_mesh = None
|
||||
|
@ -170,13 +170,13 @@ class BuildVolume(SceneNode):
|
|||
|
||||
if not self._shader:
|
||||
self._shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "default.shader"))
|
||||
self._grid_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "grid.shader"))
|
||||
self._plate_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "color.shader"))
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._grid_shader.setUniformValue("u_buildplateColor", Color(*theme.getColor("buildplate").getRgb()))
|
||||
self._plate_shader.setUniformValue("u_color", Color(*theme.getColor("buildplate").getRgb()))
|
||||
|
||||
renderer.queueNode(self, mode = RenderBatch.RenderMode.Lines)
|
||||
renderer.queueNode(self, mesh = self._origin_mesh)
|
||||
renderer.queueNode(self, mesh = self._plate_mesh, shader = self._grid_shader, backface_cull = True)
|
||||
renderer.queueNode(self, mesh = self._plate_mesh, shader = self._plate_shader, backface_cull = True)
|
||||
renderer.queueNode(self, mesh = self._grid_mesh, mode = RenderBatch.RenderMode.Lines, transparent = True)
|
||||
if self._disallowed_area_mesh:
|
||||
renderer.queueNode(self, mesh = self._disallowed_area_mesh, shader = self._shader, transparent = True, backface_cull = True, sort = -9)
|
||||
|
@ -308,6 +308,7 @@ class BuildVolume(SceneNode):
|
|||
for y in range(0, int(math.floor(min_d)), -major_grid_size):
|
||||
mb.addLine(Vector(min_w, min_h, y), Vector(max_w, min_h, y), color = self._grid_color)
|
||||
|
||||
#More fine grained grid.
|
||||
minor_grid_size = 1
|
||||
for x in range(0, int(math.ceil(max_w)), minor_grid_size):
|
||||
if x % major_grid_size == 0: #Don't overlap with the major grid.
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
[shaders]
|
||||
vertex =
|
||||
uniform highp mat4 u_modelViewProjectionMatrix;
|
||||
|
||||
attribute highp vec4 a_vertex;
|
||||
attribute lowp vec2 a_uvs;
|
||||
|
||||
varying lowp vec2 v_uvs;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = u_modelViewProjectionMatrix * a_vertex;
|
||||
v_uvs = a_uvs;
|
||||
}
|
||||
|
||||
fragment =
|
||||
uniform lowp vec4 u_buildplateColor;
|
||||
varying lowp vec2 v_uvs;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = u_buildplateColor;
|
||||
}
|
||||
|
||||
vertex41core =
|
||||
#version 410
|
||||
uniform highp mat4 u_modelViewProjectionMatrix;
|
||||
|
||||
in highp vec4 a_vertex;
|
||||
in lowp vec2 a_uvs;
|
||||
|
||||
out lowp vec2 v_uvs;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = u_modelViewProjectionMatrix * a_vertex;
|
||||
v_uvs = a_uvs;
|
||||
}
|
||||
|
||||
fragment41core =
|
||||
#version 410
|
||||
uniform lowp vec4 u_buildplateColor;
|
||||
in lowp vec2 v_uvs;
|
||||
out vec4 frag_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = u_buildplateColor;
|
||||
}
|
||||
|
||||
[defaults]
|
||||
u_buildplateColor = [0.96, 0.96, 0.96, 1.0]
|
||||
|
||||
[bindings]
|
||||
u_modelViewProjectionMatrix = model_view_projection_matrix
|
||||
|
||||
[attributes]
|
||||
a_vertex = vertex
|
||||
a_uvs = uv0
|
Loading…
Add table
Add a link
Reference in a new issue