BLT-With-Graphics-Template/include/blt/gfx/renderer/shaders/2d_font.frag

25 lines
490 B
GLSL
Raw Normal View History

2024-11-11 19:21:42 -05:00
#ifdef __cplusplus
#include <string>
const std::string shader_2d_font_frag = R"("
2024-11-12 18:26:34 -05:00
#version 300 es
precision mediump float;
2024-11-11 19:21:42 -05:00
2024-11-12 18:26:34 -05:00
layout (location = 0) out vec4 FragColor;
in vec2 uv;
2024-11-11 19:21:42 -05:00
2024-11-12 18:26:34 -05:00
uniform sampler2D tex;
uniform vec4 color;
2024-11-11 19:21:42 -05:00
2024-11-12 18:26:34 -05:00
void main() {
2024-11-14 11:26:37 -05:00
if (texture(tex, uv).r > 0.2)
FragColor = color;
else
2024-11-12 18:26:34 -05:00
discard;
2024-11-14 11:26:37 -05:00
// if (FragColor.a < 0.2)
// discard;
// else
// FragColor.a = 1.0;
2024-11-12 18:26:34 -05:00
}
2024-11-11 19:21:42 -05:00
")";
#endif