mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
Tech ENABLE_GLBEGIN_GLEND_SHADERS_ATTRIBUTES - Use vertex attributes and matrices in shaders. 1st installment.
Shader: flat - Default bed (cherry picked from commit prusa3d/PrusaSlicer@a5ff37013b)
This commit is contained in:
parent
5fc056edfb
commit
9f4713eee8
6 changed files with 77 additions and 14 deletions
|
@ -2496,13 +2496,16 @@ bool PartPlate::intersects(const BoundingBoxf3& bb) const
|
|||
|
||||
void PartPlate::render(bool bottom, bool only_body, bool force_background_color, HeightLimitMode mode, int hover_id, bool render_cali)
|
||||
{
|
||||
GLShaderProgram *shader = wxGetApp().get_shader("flat");
|
||||
GLShaderProgram *shader = wxGetApp().get_shader("flat_attr");
|
||||
if (shader != nullptr) {
|
||||
shader->start_using();
|
||||
glsafe(::glEnable(GL_DEPTH_TEST));
|
||||
glsafe(::glEnable(GL_BLEND));
|
||||
glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
|
||||
|
||||
const Transform3d matrix = wxGetApp().plater()->get_camera().get_projection_view_matrix();
|
||||
shader->set_uniform("projection_view_model_matrix", matrix);
|
||||
|
||||
if (!bottom) {
|
||||
// draw background
|
||||
render_background(force_background_color);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue