From 8829759b77259e0c8cfb033f66ccbde0eb481471 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Thu, 12 Feb 2026 16:37:43 +0100 Subject: rename --- assets/text_shader.glsl | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 assets/text_shader.glsl (limited to 'assets/text_shader.glsl') diff --git a/assets/text_shader.glsl b/assets/text_shader.glsl new file mode 100644 index 0000000..3b6ed18 --- /dev/null +++ b/assets/text_shader.glsl @@ -0,0 +1,38 @@ +@header #include "cglm/cglm.h" + +@vs vs_text +in vec2 in_position; +in vec2 in_uv; + +layout(binding = 0) uniform vs_text_params { + mat4 mvp; + vec4 color; +} + +out vec2 out_uv; +out vec4 out_color; + +void main() { + gl_Position = mvp * vec4(in_position, 0.0, 1.0); + out_uv = in_uv; + out_color = color; +} + +@end + +@fs fs_text +layout(binding = 0) uniform texture2D u_texture; +layout(binding = 1) uniform sampler u_sampler; + +in vec2 in_uv; +in vec4 in_color; + +out vec4 out_color; + +void main() { + float alpha = texture(sampler2D(u_texture, u_sampler), in_uv).r; + out_color = vec4(in_color.rgb, in_color.a * alpha); +} + +@end +@program text vs_text fs_text \ No newline at end of file -- cgit v1.2.3