mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Tech ENABLE_LEGACY_OPENGL_REMOVAL - Fixed calculation of normal matrices sent to shaders
(cherry picked from commit prusa3d/PrusaSlicer@c468dcbed7)
This commit is contained in:
parent
4fb5b1f904
commit
19ad0ca4d9
29 changed files with 175 additions and 152 deletions
|
@ -107,10 +107,11 @@ void GLGizmoPainterBase::render_triangles(const Selection& selection) const
|
|||
glsafe(::glFrontFace(GL_CW));
|
||||
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
const Transform3d matrix = camera.get_view_matrix() * trafo_matrix;
|
||||
shader->set_uniform("view_model_matrix", matrix);
|
||||
const Transform3d& view_matrix = camera.get_view_matrix();
|
||||
shader->set_uniform("view_model_matrix", view_matrix * trafo_matrix);
|
||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
shader->set_uniform("normal_matrix", (Matrix3d)matrix.matrix().block(0, 0, 3, 3).inverse().transpose());
|
||||
const Matrix3d view_normal_matrix = view_matrix.matrix().block(0, 0, 3, 3) * trafo_matrix.matrix().block(0, 0, 3, 3).inverse().transpose();
|
||||
shader->set_uniform("view_normal_matrix", view_normal_matrix);
|
||||
|
||||
// For printers with multiple extruders, it is necessary to pass trafo_matrix
|
||||
// to the shader input variable print_box.volume_world_matrix before
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue