From d6c6d137864879272728203be3e768c120ecac73 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 30 Nov 2023 21:13:45 +0300 Subject: [PATCH] Actually added ui3d shader --- res/shaders/ui3d.glslf | 9 +++++++++ res/shaders/ui3d.glslv | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 res/shaders/ui3d.glslf create mode 100644 res/shaders/ui3d.glslv diff --git a/res/shaders/ui3d.glslf b/res/shaders/ui3d.glslf new file mode 100644 index 00000000..6cd03590 --- /dev/null +++ b/res/shaders/ui3d.glslf @@ -0,0 +1,9 @@ +in vec2 a_textureCoord; +in vec4 a_color; +out vec4 f_color; + +uniform sampler2D u_texture; + +void main(){ + f_color = a_color * texture(u_texture, a_textureCoord); +} diff --git a/res/shaders/ui3d.glslv b/res/shaders/ui3d.glslv new file mode 100644 index 00000000..f53b1a1b --- /dev/null +++ b/res/shaders/ui3d.glslv @@ -0,0 +1,14 @@ +layout (location = 0) in vec3 v_position; +layout (location = 1) in vec2 v_textureCoord; +layout (location = 2) in vec4 v_color; + +out vec2 a_textureCoord; +out vec4 a_color; + +uniform mat4 u_projview; + +void main(){ + a_textureCoord = v_textureCoord; + a_color = v_color; + gl_Position = u_projview * vec4(v_position, 1.0); +}