Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-23 17:10:46 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-23 17:16:39 +0300
commit17c3110ae5776bb4bfb11e240d4623ea9a80e073 (patch)
tree46ce337fc0015e97af83ed7d311e2b54e1e436e7 /source/blender/blenfont
parent59286ddcf80c391094d64dcbbb94640bf73bd0d9 (diff)
Fix large font drawing blurriness in a better way.
GPU_LINEAR is there for shadow font blurring, the real issue was lack of rounding for the batch offset.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_font.c3
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index ea81106e60f..f7a926275a9 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -133,7 +133,8 @@ void blf_batch_draw_begin(FontBLF *font)
if (simple_shader) {
/* Offset is applied to each glyph. */
- copy_v2_v2(g_batch.ofs, font->pos);
+ g_batch.ofs[0] = floorf(font->pos[0]);
+ g_batch.ofs[1] = floorf(font->pos[1]);
}
else {
/* Offset is baked in modelview mat. */
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 99be8539d24..f7f1e10a480 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -244,7 +244,7 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
gc->textures[gc->texture_current] = tex;
GPU_texture_bind(tex, 0);
GPU_texture_wrap_mode(tex, false);
- GPU_texture_filters(tex, GPU_NEAREST, GPU_NEAREST);
+ GPU_texture_filters(tex, GPU_NEAREST, GPU_LINEAR);
GPU_texture_unbind(tex);
}
@@ -427,8 +427,8 @@ static void blf_glyph_calc_rect(rctf *rect, GlyphBLF *g, float x, float y)
{
rect->xmin = floorf(x + g->pos_x);
rect->xmax = rect->xmin + (float)g->width;
- rect->ymin = y + g->pos_y;
- rect->ymax = y + g->pos_y - (float)g->height;
+ rect->ymin = floorf(y + g->pos_y);
+ rect->ymax = rect->ymin - (float)g->height;
}
void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)