mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-24 21:08:19 -06:00
shaders for progressbar
This commit is contained in:
parent
bdab783360
commit
d974f8326e
15
kubi/shaders/gui/progress.frag
Normal file
15
kubi/shaders/gui/progress.frag
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#version 150 core
|
||||||
|
|
||||||
|
in vec2 v_uv;
|
||||||
|
out vec4 out_color;
|
||||||
|
uniform float progress;
|
||||||
|
uniform vec4 color;
|
||||||
|
uniform vec4 bg_color;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
if (v_uv.x <= progress) {
|
||||||
|
out_color = color;
|
||||||
|
} else {
|
||||||
|
out_color = bg_color;
|
||||||
|
}
|
||||||
|
}
|
13
kubi/shaders/gui/progress.vert
Normal file
13
kubi/shaders/gui/progress.vert
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#version 150 core
|
||||||
|
|
||||||
|
in vec2 position;
|
||||||
|
in vec2 uv;
|
||||||
|
out vec2 v_uv;
|
||||||
|
uniform vec2 ui_scale;
|
||||||
|
uniform vec2 element_position;
|
||||||
|
uniform vec2 element_size;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
v_uv = uv;
|
||||||
|
gl_Position = vec4(ui_scale * (element_position + (position * element_size)), 0.0, 1.0);
|
||||||
|
}
|
Loading…
Reference in a new issue