summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/font/fs_font_basic.sc
blob: 1c3a38be7cd5e4fa0660ad5dbde4d12c51e8b151 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$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);
}