SLA auto supports: Work with support force deficit to sprinkle support points.

Use OpenGL emissive material to render support points.
This commit is contained in:
bubnikv 2019-02-19 10:09:41 +01:00
parent cb4763bb32
commit 8b4bd7177b
4 changed files with 98 additions and 40 deletions

View file

@ -1919,6 +1919,8 @@ void GLGizmoSlaSupports::render_points(const GLCanvas3D::Selection& selection, b
}
}
::glColor3fv(render_color);
float render_color_emissive[4] = { 0.5 * render_color[0], 0.5 * render_color[1], 0.5 * render_color[2], 1.f};
::glMaterialfv(GL_FRONT, GL_EMISSION, render_color_emissive);
// Now render the sphere. Inverse matrix of the instance scaling is applied so that the
// sphere does not scale with the object.
@ -1929,6 +1931,12 @@ void GLGizmoSlaSupports::render_points(const GLCanvas3D::Selection& selection, b
::glPopMatrix();
}
{
// Reset emissive component to zero (the default value)
float render_color_emissive[4] = { 0.f, 0.f, 0.f, 1.f };
::glMaterialfv(GL_FRONT, GL_EMISSION, render_color_emissive);
}
if (!picking)
::glDisable(GL_LIGHTING);