summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/font/fs_font_basic.sc
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/common/font/fs_font_basic.sc')
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_basic.sc9
1 files changed, 3 insertions, 6 deletions
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_basic.sc b/3rdparty/bgfx/examples/common/font/fs_font_basic.sc
index 7b4b6636fde..1c3a38be7cd 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_basic.sc
+++ b/3rdparty/bgfx/examples/common/font/fs_font_basic.sc
@@ -8,11 +8,8 @@ void main()
{
vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
int index = int(v_texcoord0.w*4.0 + 0.5);
- float rgba[4];
- rgba[0] = color.z;
- rgba[1] = color.y;
- rgba[2] = color.x;
- rgba[3] = color.w;
- float alpha = rgba[index];
+ 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);
}