Added missing uniform calls for emission_factor

This commit is contained in:
enricoturri1966 2021-05-27 12:41:46 +02:00 committed by Lukas Matena
parent f69bd75464
commit e1d5d0804b
4 changed files with 13 additions and 4 deletions

View File

@ -122,6 +122,7 @@ void Bed3D::Axes::render() const
glsafe(::glEnable(GL_DEPTH_TEST));
shader->start_using();
shader->set_uniform("emission_factor", 0.0);
// x axis
std::array<float, 4> color = { 0.75f, 0.0f, 0.0f, 1.0f };
@ -489,6 +490,7 @@ void Bed3D::render_model() const
if (shader != nullptr) {
shader->start_using();
shader->set_uniform("uniform_color", m_model_color);
shader->set_uniform("emission_factor", 0.0);
::glPushMatrix();
::glTranslated(m_model_offset(0), m_model_offset(1), m_model_offset(2));
model->render();

View File

@ -227,6 +227,7 @@ void GCodeViewer::SequentialView::Marker::render() const
shader->start_using();
shader->set_uniform("uniform_color", m_color);
shader->set_uniform("emission_factor", 0.0);
glsafe(::glPushMatrix());
glsafe(::glMultMatrixf(m_world_transform.data()));

View File

@ -3918,7 +3918,7 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool
glsafe(::glEnable(GL_DEPTH_TEST));
shader->start_using();
shader->set_uniform("print_box.volume_detection", 0);
shader->set_uniform("emission_factor", 0.0);
for (GLVolume* vol : visible_volumes) {
shader->set_uniform("uniform_color", (vol->printable && !vol->is_outside) ? orange : gray);

View File

@ -1822,8 +1822,10 @@ void Selection::render_sidebar_position_hints(const std::string& sidebar_field)
{
auto set_color = [](Axis axis) {
GLShaderProgram* shader = wxGetApp().get_current_shader();
if (shader != nullptr)
if (shader != nullptr) {
shader->set_uniform("uniform_color", AXES_COLOR[axis]);
shader->set_uniform("emission_factor", 0.0);
}
};
if (boost::ends_with(sidebar_field, "x")) {
@ -1844,8 +1846,10 @@ void Selection::render_sidebar_rotation_hints(const std::string& sidebar_field)
{
auto set_color = [](Axis axis) {
GLShaderProgram* shader = wxGetApp().get_current_shader();
if (shader != nullptr)
if (shader != nullptr) {
shader->set_uniform("uniform_color", AXES_COLOR[axis]);
shader->set_uniform("emission_factor", 0.0);
}
};
auto render_sidebar_rotation_hint = [this]() {
@ -1874,8 +1878,10 @@ void Selection::render_sidebar_scale_hints(const std::string& sidebar_field) con
auto render_sidebar_scale_hint = [this, uniform_scale](Axis axis) {
GLShaderProgram* shader = wxGetApp().get_current_shader();
if (shader != nullptr)
if (shader != nullptr) {
shader->set_uniform("uniform_color", uniform_scale ? UNIFORM_SCALE_COLOR : AXES_COLOR[axis]);
shader->set_uniform("emission_factor", 0.0);
}
glsafe(::glTranslated(0.0, 5.0, 0.0));
m_arrow.render();