mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Printbed textures generated from svg files
This commit is contained in:
parent
0b0457186b
commit
11fc849b1a
16 changed files with 5124 additions and 33 deletions
20
resources/shaders/printbed.fs
Normal file
20
resources/shaders/printbed.fs
Normal file
|
@ -0,0 +1,20 @@
|
|||
#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;
|
||||
|
||||
varying vec2 tex_coords;
|
||||
|
||||
void main()
|
||||
{
|
||||
// calculates radial gradient
|
||||
vec3 back_color = vec3(mix(back_color_light, back_color_dark, smoothstep(0.0, 0.5, length(abs(tex_coords.xy) - vec2(0.5)))));
|
||||
|
||||
vec4 fore_color = texture2D(texture, tex_coords);
|
||||
|
||||
// blends foreground with background
|
||||
gl_FragColor = vec4(mix(back_color, fore_color.rgb, fore_color.a), transparent_background ? fore_color.a : 1.0);
|
||||
}
|
11
resources/shaders/printbed.vs
Normal file
11
resources/shaders/printbed.vs
Normal file
|
@ -0,0 +1,11 @@
|
|||
#version 110
|
||||
|
||||
attribute vec2 v_tex_coords;
|
||||
|
||||
varying vec2 tex_coords;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = ftransform();
|
||||
tex_coords = v_tex_coords;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue