Fixed differences after rebase with master
This commit is contained in:
parent
c468dcbed7
commit
7da94fb07d
@ -923,11 +923,8 @@ void Bed3D::render_contour(const Transform3d& view_matrix, const Transform3d& pr
|
||||
GLShaderProgram* shader = wxGetApp().get_shader("flat");
|
||||
if (shader != nullptr) {
|
||||
shader->start_using();
|
||||
|
||||
#if ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
shader->set_uniform("view_model_matrix", view_matrix);
|
||||
shader->set_uniform("projection_matrix", projection_matrix);
|
||||
#endif // ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
|
||||
glsafe(::glEnable(GL_DEPTH_TEST));
|
||||
glsafe(::glEnable(GL_BLEND));
|
||||
|
@ -3025,9 +3025,9 @@ void GCodeViewer::render_toolpaths()
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
const std::array<int, 4>& viewport = camera.get_viewport();
|
||||
const double zoom = camera.get_zoom();
|
||||
const float zoom = float(camera.get_zoom());
|
||||
shader.set_uniform("viewport_size", Vec2d(double(viewport[2]), double(viewport[3])));
|
||||
shader.set_uniform("width", (zoom < 5.0) ? 1.0 : (1.0 + 5.0 * (zoom - 5.0) / (100.0 - 5.0)));
|
||||
shader.set_uniform("width", (zoom < 5.0f) ? 0.5f : (0.5f + 5.0f * (zoom - 5.0f) / (100.0f - 5.0f)));
|
||||
shader.set_uniform("gap_size", 0.0f);
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
|
||||
@ -3325,7 +3325,7 @@ void GCodeViewer::render_toolpaths()
|
||||
shader->set_uniform("view_normal_matrix", (Matrix3d)Matrix3d::Identity());
|
||||
|
||||
const int position_id = shader->get_attrib_location("v_position");
|
||||
const int normal_id = shader->get_attrib_location("v_normal");
|
||||
const int normal_id = shader->get_attrib_location("v_normal");
|
||||
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
|
@ -112,20 +112,6 @@ void GLGizmoBase::Grabber::render(float size, const ColorRGBA& render_color, boo
|
||||
#else
|
||||
m_cube.set_color(-1, render_color);
|
||||
#endif // ENABLE_GIZMO_GRABBER_REFACTOR
|
||||
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
#if ENABLE_GIZMO_GRABBER_REFACTOR
|
||||
const Transform3d view_model_matrix = camera.get_view_matrix() * matrix * Geometry::assemble_transform(center, angles, 2.0 * half_size * Vec3d::Ones());
|
||||
#else
|
||||
const Transform3d view_model_matrix = camera.get_view_matrix() * matrix * Geometry::assemble_transform(center, angles, fullsize * Vec3d::Ones());
|
||||
#endif // ENABLE_GIZMO_GRABBER_REFACTOR
|
||||
const Transform3d& projection_matrix = camera.get_projection_matrix();
|
||||
|
||||
shader->set_uniform("view_model_matrix", view_model_matrix);
|
||||
shader->set_uniform("projection_matrix", projection_matrix);
|
||||
shader->set_uniform("normal_matrix", (Matrix3d)view_model_matrix.matrix().block(0, 0, 3, 3).inverse().transpose());
|
||||
#else
|
||||
glsafe(::glPushMatrix());
|
||||
glsafe(::glTranslated(center.x(), center.y(), center.z()));
|
||||
glsafe(::glRotated(Geometry::rad2deg(angles.z()), 0.0, 0.0, 1.0));
|
||||
@ -136,6 +122,7 @@ void GLGizmoBase::Grabber::render(float size, const ColorRGBA& render_color, boo
|
||||
#else
|
||||
glsafe(::glScaled(fullsize, fullsize, fullsize));
|
||||
#endif // ENABLE_GIZMO_GRABBER_REFACTOR
|
||||
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
#if ENABLE_GIZMO_GRABBER_REFACTOR
|
||||
s_cube.render();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user