mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-10 10:47:16 +00: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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user