mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:50:06 +00:00
Scalable fonts using freetype-gl
This commit is contained in:
parent
ec8e2643ff
commit
289ed430c7
8 changed files with 400 additions and 181 deletions
|
|
@ -1,12 +1,17 @@
|
|||
#version 330 core
|
||||
|
||||
in vec2 texCoords;
|
||||
in vec4 textColor;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
uniform sampler2D text;
|
||||
uniform vec4 textColor;
|
||||
uniform sampler2D uTexture;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 sampled = vec4(1.0f, 1.0f, 1.0f, texture(text, texCoords).r);
|
||||
color = textColor * sampled;
|
||||
float dist = texture(uTexture, texCoords).r;
|
||||
float width = fwidth(dist);
|
||||
float alpha = smoothstep(0.5f - width, 0.5f + width, dist);
|
||||
|
||||
color = vec4(textColor.rgb, textColor.a * alpha);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue