From a8d5b4a75288deeb68ae45e3a7ef6ab1a3b69253 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Wed, 22 Nov 2023 18:40:35 +0100 Subject: [PATCH] fix ui shader --- kubi-ui/shaders/fragment.frag | 7 ++++--- kubi-ui/shaders/vertex.vert | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/kubi-ui/shaders/fragment.frag b/kubi-ui/shaders/fragment.frag index 178c33a..f450433 100644 --- a/kubi-ui/shaders/fragment.frag +++ b/kubi-ui/shaders/fragment.frag @@ -1,10 +1,11 @@ #version 300 es precision highp float; + out vec4 out_color; -uniform vec4 color; +in vec4 vtx_color; void main() { - if (color.w <= 0.) discard; - out_color = color; + if (vtx_color.w <= 0.) discard; + out_color = vtx_color; } diff --git a/kubi-ui/shaders/vertex.vert b/kubi-ui/shaders/vertex.vert index cd61047..a39f118 100644 --- a/kubi-ui/shaders/vertex.vert +++ b/kubi-ui/shaders/vertex.vert @@ -1,9 +1,13 @@ #version 300 es precision highp float; -in vec2 position; + uniform vec2 resolution; +in vec4 color; +in vec2 position; +out vec4 vtx_color; void main() { + vtx_color = color; gl_Position = vec4(vec2(1., -1.) * (position / resolution), 0., 1.); }