NEW:add flat shader for cut tool

Jira:STUDIO-4227
thanks for PrusaSlcer and enricoturri1966

commit 76d1d4949bbd0964717f8112aae992a1267c5eb4
Author: enricoturri1966 <enricoturri@seznam.cz>
Date:   Mon Mar 21 13:10:47 2022 +0100
    Tech ENABLE_GL_SHADERS_ATTRIBUTES - Added shaders for glsl version 140
...

Change-Id: I4db00805830f07a5eaa95cfc7b8254c61b86f0c8
This commit is contained in:
zhou.xu 2023-09-08 09:41:45 +08:00 committed by Lane.Wei
parent b32b1d2462
commit 26b8ca6599
3 changed files with 24 additions and 4 deletions

View file

@ -0,0 +1,8 @@
#version 110
uniform vec4 uniform_color;
void main()
{
gl_FragColor = uniform_color;
}

11
resources/shaders/flat.vs Normal file
View file

@ -0,0 +1,11 @@
#version 110
uniform mat4 view_model_matrix;
uniform mat4 projection_matrix;
attribute vec3 v_position;
void main()
{
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
}

View file

@ -34,11 +34,12 @@ std::pair<bool, std::string> GLShadersManager::init()
bool valid = true;
// used to render bed axes and model, selection hints, gcode sequential view marker model, preview shells, options in gcode preview
valid &= append_shader("gouraud_light", { "gouraud_light.vs", "gouraud_light.fs" });
valid &= append_shader("gouraud_light", { "gouraud_light.vs", "gouraud_light.fs" });
//used to render thumbnail
valid &= append_shader("thumbnail", { "thumbnail.vs", "thumbnail.fs" });
// used to render first layer for calibration
valid &= append_shader("cali", { "cali.vs", "cali.fs"});
valid &= append_shader("thumbnail", { "thumbnail.vs", "thumbnail.fs" });
// used to render first layer for calibration
valid &= append_shader("cali", { "cali.vs", "cali.fs"});
valid &= append_shader("flat", {"flat.vs", "flat.fs"});
// used to render printbed
valid &= append_shader("printbed", { "printbed.vs", "printbed.fs" });
// used to render options in gcode preview