mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-01-31 00:48:41 +03:00
update resources
This commit is contained in:
8
resources/shaders/110/flat.fs
Normal file
8
resources/shaders/110/flat.fs
Normal file
@@ -0,0 +1,8 @@
|
||||
#version 110
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = uniform_color;
|
||||
}
|
||||
11
resources/shaders/110/flat.vs
Normal file
11
resources/shaders/110/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);
|
||||
}
|
||||
12
resources/shaders/110/flat_instance.vs
Normal file
12
resources/shaders/110/flat_instance.vs
Normal file
@@ -0,0 +1,12 @@
|
||||
#version 110
|
||||
|
||||
uniform mat4 view_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec2 v_undefine;
|
||||
attribute mat4 instanceMatrix;
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * view_matrix * instanceMatrix * vec4(v_position, 1.0);
|
||||
}
|
||||
34
resources/shaders/110/printbed.fs
Normal file
34
resources/shaders/110/printbed.fs
Normal file
@@ -0,0 +1,34 @@
|
||||
#version 110
|
||||
|
||||
const vec3 back_color_dark = vec3(0.235, 0.235, 0.235);
|
||||
const vec3 back_color_light = vec3(0.365, 0.365, 0.365);
|
||||
|
||||
uniform sampler2D texture;
|
||||
uniform bool transparent_background;
|
||||
uniform bool svg_source;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
vec4 svg_color()
|
||||
{
|
||||
// takes foreground from texture
|
||||
vec4 fore_color = texture2D(texture, tex_coord);
|
||||
|
||||
// calculates radial gradient
|
||||
vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coord.xy) - vec2(0.5)))));
|
||||
|
||||
// blends foreground with background
|
||||
return vec4(mix(back_color, fore_color.rgb, fore_color.a), transparent_background ? fore_color.a : 1.0);
|
||||
}
|
||||
|
||||
vec4 non_svg_color()
|
||||
{
|
||||
// takes foreground from texture
|
||||
vec4 color = texture2D(texture, tex_coord);
|
||||
return vec4(color.rgb, transparent_background ? color.a * 0.25 : color.a);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = svg_source ? svg_color() : non_svg_color();
|
||||
}
|
||||
15
resources/shaders/110/printbed.vs
Normal file
15
resources/shaders/110/printbed.vs
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 110
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
attribute vec3 v_position;
|
||||
attribute vec2 v_tex_coord;
|
||||
|
||||
varying vec2 tex_coord;
|
||||
|
||||
void main()
|
||||
{
|
||||
tex_coord = v_tex_coord;
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user