mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 22:24:01 -06:00
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:
parent
b32b1d2462
commit
26b8ca6599
3 changed files with 24 additions and 4 deletions
8
resources/shaders/flat.fs
Normal file
8
resources/shaders/flat.fs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#version 110
|
||||||
|
|
||||||
|
uniform vec4 uniform_color;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_FragColor = uniform_color;
|
||||||
|
}
|
11
resources/shaders/flat.vs
Normal file
11
resources/shaders/flat.vs
Normal 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);
|
||||||
|
}
|
|
@ -34,11 +34,12 @@ std::pair<bool, std::string> GLShadersManager::init()
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
|
|
||||||
// used to render bed axes and model, selection hints, gcode sequential view marker model, preview shells, options in gcode preview
|
// 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
|
//used to render thumbnail
|
||||||
valid &= append_shader("thumbnail", { "thumbnail.vs", "thumbnail.fs" });
|
valid &= append_shader("thumbnail", { "thumbnail.vs", "thumbnail.fs" });
|
||||||
// used to render first layer for calibration
|
// used to render first layer for calibration
|
||||||
valid &= append_shader("cali", { "cali.vs", "cali.fs"});
|
valid &= append_shader("cali", { "cali.vs", "cali.fs"});
|
||||||
|
valid &= append_shader("flat", {"flat.vs", "flat.fs"});
|
||||||
// used to render printbed
|
// used to render printbed
|
||||||
valid &= append_shader("printbed", { "printbed.vs", "printbed.fs" });
|
valid &= append_shader("printbed", { "printbed.vs", "printbed.fs" });
|
||||||
// used to render options in gcode preview
|
// used to render options in gcode preview
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue