Age | Commit message (Collapse) | Author |
|
|
|
|
|
Make color values compact. Set color once per primitive. Use new immSkipAttrib to avoid useless color copies.
All of this should make text drawing less CPU hungry.
|
|
We still need to BeginAtMost instead of simple Begin, since some glyphs could be clipped & not drawn.
|
|
While trying to simplify text drawing, noticed no Blender code uses the blur feature. Hopefully scripts don't use it!
|
|
Was one draw call per glyph, now one per line.
Still room for improvement here.
|
|
Part of T49043
|
|
All text was displaying black.
BLF uses alpha-only textures which aren't supported by the basic-shader,
Workaround this by using texture swizzle so the RGB components of the texture are set to 1.
|
|
|
|
need it.
|
|
Maybe this is pedantic but I read it’s best to explicitly set the
desired component size.
Also append “_ARB” to float texture formats since those need an
extension in GL 2.1.
|
|
|
|
Very minor, but since it was reported...
|
|
|
|
also edit comments for knife tool
|
|
also use UNLIKELY for error cases
|
|
|
|
Each dpi value stores its own set of font sizes, so while dragging the
dpi value would collect many sizes and never free.
Also change how BLF_cache_clear works,
it was freeing memory but not the OpenGL textures.
Now just free all the cache and GL textures and let drawing allocate them again as needed.
|
|
|
|
|
|
place (pragmas were copied around).
also enable more strict warnings for BLF (which had some incorrect casts).
|
|
takes a key as an arg and isnt popping any element from the hash as you might expect).
add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.
|
|
|
|
render.
Printing text on the color grid image would initialize font glyphs from a thread at
the same time as the UI, causing conflicts. The freetype glyph renderer needs to be
mutex locked because it uses a shared buffer internally even when rendering for
different fonts. Also needed to change the image generate function to use the render
monospace font to avoid conflicts in blenfont.
What's still weak in the blenfont API is that there is no distinction between a font
and a thread using that font to render with some particular size, style, etc.
|
|
clipping without the shadow since not-drawing characters because of subtle effect is rather annoying.
|
|
and BLF.
|
|
blender-playanim and not really needed.
this reverts part of 55995
|
|
functions aware of this limit.
|
|
Added "Panel Title" style to Theme settings.
Allows to make these nice larger or draw differently.
Also tried to put hinting in Style, but this needs to be a per-font
setting. uiFont data is still not being saved (also not allowing
to set own font files for UI). That's a todo for 267 then.
|
|
|
|
debug option.
|
|
applied to the characters y offset causing out of bounds pixels to be requested from glTexSubImage2D().
also clamp width, height of the character bitmap to the bitmap bounds since this can still happen for very small text (2-3 pixels high).
|
|
|
|
our naming convention.
|
|
|
|
|
|
|
|
|
|
else if's
|
|
|
|
|
|
|
|
- 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.
|
|
As Campbell point, this is to avoid call glGet/glTexEnvi
on each character.
|
|
[#25834] no color of textobjects in game engine when combined with
textured objects
[#26893] Curruption of displayed text (debug properties/fps info or bgui)
when using animated/tile uv mode
The first bug was beacuse a bad mode on the texture environment, now
we save the current glTexEnvi, set the one that we need, draw and
restore the original at the end.
The second was because a missing call to glLoadIdentity for the
texture matrix and as we do before, now we do a gl-Push/Identity/Pop
for this matrix to.
The first problem was solved by Kanttori and the second by Dalai.
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
when toggling use antialising user preference. Also fix some other use of
uninitialized memory found by valgrind.
|
|
|
|
glGetIntegerv(GL_TEXTURE_2D_BINDING_EXT, &cur_tex);
... with shadow enabled glGetFloatv(GL_CURRENT_COLOR, color) was called twice per character as well.
Now only call glGetFloatv(GL_CURRENT_COLOR, ...) once per string and only when drawing with shadow or blur, texture bind is stored in the font.
Gives 8% overall FPS speedup when displaying heavy UI in my test.
|
|
|