From 9a88e750a3805d4ba88d1119ea290ecd27000869 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Thu, 12 Feb 2026 16:48:28 +0100 Subject: fix header --- assets/text_shader.c | 4 ++++ assets/text_shader.glsl | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 assets/text_shader.c (limited to 'assets') diff --git a/assets/text_shader.c b/assets/text_shader.c new file mode 100644 index 0000000..6657459 --- /dev/null +++ b/assets/text_shader.c @@ -0,0 +1,4 @@ +#include "sokol_gfx.h" +// ensure order +#define SOKOL_SHDC_IMPL +#include "text_shader.h" \ No newline at end of file diff --git a/assets/text_shader.glsl b/assets/text_shader.glsl index 3b6ed18..b59b6eb 100644 --- a/assets/text_shader.glsl +++ b/assets/text_shader.glsl @@ -4,10 +4,10 @@ in vec2 in_position; in vec2 in_uv; -layout(binding = 0) uniform vs_text_params { +layout(binding = 0) uniform text_params { mat4 mvp; vec4 color; -} +}; out vec2 out_uv; out vec4 out_color; @@ -24,14 +24,14 @@ void main() { layout(binding = 0) uniform texture2D u_texture; layout(binding = 1) uniform sampler u_sampler; -in vec2 in_uv; -in vec4 in_color; +in vec2 out_uv; +in vec4 out_color; -out vec4 out_color; +out vec4 frag_color; void main() { - float alpha = texture(sampler2D(u_texture, u_sampler), in_uv).r; - out_color = vec4(in_color.rgb, in_color.a * alpha); + float alpha = texture(sampler2D(u_texture, u_sampler), out_uv).r; + frag_color = vec4(out_color.rgb, out_color.a * alpha); } @end -- cgit v1.2.3