shaders for progressbar

This commit is contained in:
griffi-gh 2023-02-08 03:37:58 +01:00
parent a6a728ba10
commit 9f2e47df8c
2 changed files with 28 additions and 0 deletions

View 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;
}
}

View 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);
}