bgfx/examples/common/font/fs_font_basic.sc
Brian Richardson 650c1733be Tweak fs_font_basic shader to work on Raspberry Pi 3. (#1803)
DX shaders not updated because I'm not on Windows.
2019-07-12 21:53:12 -07:00

16 lines
359 B
Python

$input v_color0, v_texcoord0
#include "../../common/common.sh"
SAMPLERCUBE(s_texColor, 0);
void main()
{
vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
int index = int(v_texcoord0.w*4.0 + 0.5);
float alpha = index < 1 ? color.z :
index < 2 ? color.y :
index < 3 ? color.x : color.w;
gl_FragColor = vec4(v_color0.xyz, v_color0.a * alpha);
}