2024-02-12 09:56:46 +00:00
|
|
|
in vec2 uv;
|
|
|
|
in float color_index;
|
|
|
|
|
|
|
|
uniform sampler2D sampler_font;
|
|
|
|
uniform sampler1D sampler_colors;
|
|
|
|
uniform float num_colors;
|
2024-03-26 18:13:55 +00:00
|
|
|
uniform float gamma; /// set:2.2
|
2024-02-12 09:56:46 +00:00
|
|
|
|
|
|
|
out vec4 outColor;
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
vec4 col = texture(sampler_colors, (color_index+0.5)/num_colors);
|
|
|
|
float s = texture(sampler_font, uv).r;
|
|
|
|
outColor = vec4(col.rgb, s*col.a);
|
2024-03-26 18:13:55 +00:00
|
|
|
outColor.rgb = pow(outColor.rgb, vec3(gamma));
|
2024-02-12 09:56:46 +00:00
|
|
|
}
|