mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 22:35:58 +08:00
Fixed conflicts after merge with master
This commit is contained in:
commit
b75cea2035
@ -1,13 +1,8 @@
|
||||
#version 110
|
||||
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = uniform_color;
|
||||
// Values inside depth buffer for fragments of the contour of a selected area are offset
|
||||
// by small epsilon to solve z-fighting between painted triangles and contour lines.
|
||||
gl_FragDepth = gl_FragCoord.z - EPSILON;
|
||||
}
|
||||
|
@ -7,5 +7,8 @@ attribute vec3 v_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
// Add small epsilon to z to solve z-fighting between painted triangles and contour lines.
|
||||
vec4 clip_position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
clip_position.z -= 0.00001 * abs(clip_position.w);
|
||||
gl_Position = clip_position;
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
#version 140
|
||||
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
out vec4 out_color;
|
||||
@ -9,7 +7,4 @@ out vec4 out_color;
|
||||
void main()
|
||||
{
|
||||
out_color = uniform_color;
|
||||
// Values inside depth buffer for fragments of the contour of a selected area are offset
|
||||
// by small epsilon to solve z-fighting between painted triangles and contour lines.
|
||||
gl_FragDepth = gl_FragCoord.z - EPSILON;
|
||||
}
|
||||
|
@ -7,5 +7,8 @@ in vec3 v_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
// Add small epsilon to z to solve z-fighting between painted triangles and contour lines.
|
||||
vec4 clip_position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
clip_position.z -= 0.00001 * abs(clip_position.w);
|
||||
gl_Position = clip_position;
|
||||
}
|
||||
|
@ -1,11 +1,6 @@
|
||||
#version 110
|
||||
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
// Values inside depth buffer for fragments of the contour of a selected area are offset
|
||||
// by small epsilon to solve z-fighting between painted triangles and contour lines.
|
||||
gl_FragDepth = gl_FragCoord.z - EPSILON;
|
||||
}
|
||||
|
@ -2,5 +2,8 @@
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = ftransform();
|
||||
// Add small epsilon to z to solve z-fighting between painted triangles and contour lines.
|
||||
vec4 clip_position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
clip_position.z -= 0.00001 * abs(clip_position.w);
|
||||
gl_Position = clip_position;
|
||||
}
|
||||
|
@ -621,11 +621,7 @@ void TriangleSelectorMmGui::render(ImGuiWrapper *imgui)
|
||||
|
||||
auto *contour_shader = wxGetApp().get_shader("mm_contour");
|
||||
contour_shader->start_using();
|
||||
|
||||
glsafe(::glDepthFunc(GL_LEQUAL));
|
||||
m_paint_contour.render();
|
||||
glsafe(::glDepthFunc(GL_LESS));
|
||||
|
||||
contour_shader->stop_using();
|
||||
}
|
||||
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
|
@ -992,11 +992,7 @@ void TriangleSelectorGUI::render(ImGuiWrapper* imgui)
|
||||
|
||||
auto *contour_shader = wxGetApp().get_shader("mm_contour");
|
||||
contour_shader->start_using();
|
||||
|
||||
glsafe(::glDepthFunc(GL_LEQUAL));
|
||||
m_paint_contour.render();
|
||||
glsafe(::glDepthFunc(GL_LESS));
|
||||
|
||||
contour_shader->stop_using();
|
||||
}
|
||||
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
@ -1387,10 +1383,7 @@ void TriangleSelectorGUI::render_paint_contour(const Transform3d& matrix)
|
||||
contour_shader->set_uniform("view_model_matrix", camera.get_view_matrix() * matrix);
|
||||
contour_shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
|
||||
glsafe(::glDepthFunc(GL_LEQUAL));
|
||||
m_paint_contour.render();
|
||||
glsafe(::glDepthFunc(GL_LESS));
|
||||
|
||||
contour_shader->stop_using();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user