diff options
author | Alex Fraser <alex@phatcore.com> | 2012-02-04 05:51:59 +0400 |
---|---|---|
committer | Alex Fraser <alex@phatcore.com> | 2012-02-04 05:51:59 +0400 |
commit | a05fdb837b89f2fba04587e99d0eecaa9cf174c3 (patch) | |
tree | 3739d95c3a2b10d1ae7cc8a0723ba3cb19924e0a /source/gameengine/BlenderRoutines | |
parent | dc97e07134c48aacf5e3de4436d70e7b71fbecaa (diff) |
Fix for aliased fonts in the game engine.
- Mipmaps are generated in BLF when drawing text in-game. In that case, padding around each glyph is increased to prevent bleeding.
- Texture filtering is turned on for in-game text.
- All glyphs are now "twisted": the leading edge is brought a small distance forward, to prevent z-fighting in overlapping (kerned) glyphs. This happens both in the game engine and the rest of the UI, but should have no effect in the UI due to Z-compression in the clipping matrix.
Reviewed and approved by bdiego; see patch [#29882] in the tracker. Tested by dfelinto.
Diffstat (limited to 'source/gameengine/BlenderRoutines')
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index 7a99a4a1419..78dcfc8edd9 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -136,8 +136,8 @@ void BL_print_game_line(int fontid, const char* text, int size, int dpi, float* /* the actual drawing */ glColor4fv(color); + BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT|BLF_TEXFILTER); /* multiply the text matrix by the object matrix */ - BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT); BLF_matrix(fontid, mat); /* aspect is the inverse scale that allows you to increase */ @@ -149,7 +149,7 @@ void BL_print_game_line(int fontid, const char* text, int size, int dpi, float* BLF_position(fontid, 0, 0, 0); BLF_draw(fontid, (char *)text, 65535); - BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT); + BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT|BLF_TEXFILTER); } void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height) |