mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-06 14:37:36 -06:00
Fix brim ear render when camera projection changed (#9605)
* Fix brim ear render when camera projection changed (SoftFever/OrcaSlicer#9602) * Remove unnecessary shader uniform
This commit is contained in:
parent
a008014ab0
commit
bd67bd8270
2 changed files with 11 additions and 7 deletions
|
@ -212,8 +212,8 @@ void Bed3D::Axes::render()
|
|||
const Transform3d& view_matrix = camera.get_view_matrix();
|
||||
shader->set_uniform("view_model_matrix", view_matrix * transform);
|
||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
const Matrix3d view_normal_matrix = view_matrix.matrix().block(0, 0, 3, 3) * transform.matrix().block(0, 0, 3, 3).inverse().transpose();
|
||||
shader->set_uniform("view_normal_matrix", view_normal_matrix);
|
||||
//const Matrix3d view_normal_matrix = view_matrix.matrix().block(0, 0, 3, 3) * transform.matrix().block(0, 0, 3, 3).inverse().transpose();
|
||||
//shader->set_uniform("view_normal_matrix", view_normal_matrix);
|
||||
m_arrow.render();
|
||||
};
|
||||
|
||||
|
@ -228,7 +228,7 @@ void Bed3D::Axes::render()
|
|||
glsafe(::glEnable(GL_DEPTH_TEST));
|
||||
|
||||
shader->start_using();
|
||||
shader->set_uniform("emission_factor", 0.0f);
|
||||
//shader->set_uniform("emission_factor", 0.0f);
|
||||
|
||||
// x axis
|
||||
m_arrow.set_color(AXIS_X_COLOR);
|
||||
|
|
|
@ -110,10 +110,12 @@ void GLGizmoBrimEars::render_points(const Selection &selection)
|
|||
|
||||
if (!has_points) return;
|
||||
|
||||
GLShaderProgram *shader = wxGetApp().get_shader("gouraud_light");
|
||||
if (shader != nullptr) shader->start_using();
|
||||
const auto shader = wxGetApp().get_shader("gouraud_light");
|
||||
if (shader == nullptr)
|
||||
return;
|
||||
shader->start_using();
|
||||
ScopeGuard guard([shader]() {
|
||||
if (shader != nullptr) shader->stop_using();
|
||||
shader->stop_using();
|
||||
});
|
||||
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
|
@ -122,6 +124,8 @@ void GLGizmoBrimEars::render_points(const Selection &selection)
|
|||
const Transform3d &instance_scaling_matrix_inverse = vol->get_instance_transformation().get_scaling_factor_matrix().inverse();
|
||||
const Transform3d &instance_matrix = vol->get_instance_transformation().get_matrix();
|
||||
|
||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
|
||||
ColorRGBA render_color;
|
||||
for (size_t i = 0; i < cache_size; ++i) {
|
||||
const BrimPoint &brim_point = editing_cache[i].brim_point;
|
||||
|
@ -151,7 +155,7 @@ void GLGizmoBrimEars::render_points(const Selection &selection)
|
|||
}
|
||||
|
||||
m_cylinder.model.set_color(render_color);
|
||||
if (shader) shader->set_uniform("emission_factor", 0.5f);
|
||||
shader->set_uniform("emission_factor", 0.5f);
|
||||
|
||||
if (vol->is_left_handed()) glFrontFace(GL_CW);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue