bgfx/examples/common/font/fs_font_basic.sc

16 lines
359 B
Python
Raw Normal View History

2013-04-23 00:42:11 +04:00
$input v_color0, v_texcoord0
#include "../../common/common.sh"
2015-07-29 09:16:23 +03:00
SAMPLERCUBE(s_texColor, 0);
2013-04-23 00:42:11 +04:00
void main()
2013-06-04 10:16:02 +04:00
{
2015-07-29 09:16:23 +03:00
vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
2013-06-04 10:16:02 +04:00
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;
2013-06-08 09:45:02 +04:00
gl_FragColor = vec4(v_color0.xyz, v_color0.a * alpha);
2013-04-23 00:42:11 +04:00
}