v4k-git-backup/engine/art/shaders/fs_font.glsl

15 lines
326 B
Plaintext
Raw Permalink Normal View History

2024-02-12 09:56:46 +00:00
in vec2 uv;
in float color_index;
uniform sampler2D sampler_font;
2024-08-12 15:10:31 +00:00
uniform sampler2D sampler_colors;
2024-02-12 09:56:46 +00:00
uniform float num_colors;
out vec4 outColor;
void main() {
2024-08-12 15:10:31 +00:00
vec4 col = texture(sampler_colors, vec2((color_index+0.5)/num_colors, 0.));
2024-02-12 09:56:46 +00:00
float s = texture(sampler_font, uv).r;
outColor = vec4(col.rgb, s*col.a);
}