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
AgeCommit message (Collapse)Author
2018-03-31BLF: Perf: Add a kerning cache table for ascii chars.Clément Foucault
This adds less than a megabyte of mem usage. FT_Get_Kerning was the 2nd hotspot when profilling. This commit completly remove this cost. One concern though: I don't know if the kerning data is constant for every sizes but it seems to be the case. I tested different fonts at different dpi scalling and saw no differences.
2018-03-31Cleanup: blf internal struct namingCampbell Barton
- use x/y/width/height/max as a suffix. - replace 'num' prefix /w 'len' suffix.
2018-03-31Cleanup: BLF batch drawing namingCampbell Barton
- batching -> batch_draw. - ct & size -> len. - start/end -> begin/end (follow GL convention).
2018-03-30BFL: Fix broken vertical texts.Clément Foucault
I've made a separate version of the geom shader that works with full 3D modelviewmat. This commit also includes some fixup inside blf_batching_start().
2018-03-30BLF: Add Batching capabilities.Clément Foucault
You can now use BLF_batching_start and BLF_batching_end to batch every drawcall to BLF together minimizing the overhead introduced by BLF and the opengl driver. These calls cannot be nested (for now). If the modelview matrix changes, previously batched calls are issued and a the process resume with the new matrix. However the projection matrix MUST not change and gl scissors as well.
2018-03-30BLF: Use Batch API instead of IMM.Clément Foucault
This is not a perfect win just yet. It's now calling glBufferSubData for every call (instead of using glMapBufferRange which is almost faster), but with this system we will be able to batch drawcalls together. See next commit.
2018-03-29BLF: Reduce the size of the buffer requested to IMM.Clément Foucault
There is no point to not call strlen if the number of char is large.
2018-03-29BLF: Perf: Divide by 6 the amount of verts sent to the GPU.Clément Foucault
This means smaller imm buffer usage. This does not reduce the number of drawcalls. This uses geometry shader which is slow for the GPU but given we are really CPU bound on this case, it should not matter. A perfect implementation would: - Set the glyph coord in a bufferTexture and just send the glyph ID to the GPU to read the bufferTexture. - Use GWN_draw_primitive and draw 2*strllen triangle and just retrieve the glyph ID and color based on gl_VertexID / 6. - Stream fixed size buffer that the Driver can discard quickly but this is the same as improving IMM directly.
2018-03-26Merge branch 'master' into blender2.8Sergey Sharybin
2018-03-26BLF: Don't use user preferencesSergey Sharybin
BLF is a low level module, which might (and is) used without Blender. Thanks Campbell for review!
2018-03-26BLF: Cleanup, indentation inside of preprocessorSergey Sharybin
2018-03-25GPUTexture: Small refactor.Clément Foucault
This includes a few modification: - The biggest one is call glActiveTexture before doing any call to glBindTexture for rendering purpose (uniform value depends on it). This is also better to know what's going on when rendering UI. So if there is missing UI elements because of this commit look for this first. This allows us to have "less calls" to glActiveTexture (I did not measure the final count) and less checks inside GPU_texture. - Remove use of GL_TEXTURE0 as a uniform value in a few places. - Be more strict and use BLI_assert for bad usage of GPU_texture functions. - Disable filtering for integer and stencil textures (not supported by OGL specs). - Replace bools inside GPUTexture by a bitflag supporting more options to identify texture types.
2018-02-14GPU: use alpha blend that works for drawing to transparent buffer.Brecht Van Lommel
It's unlikely to ever be intentional to square the source alpha, as happens with glBlendFunc, so this changes the blending throughout the code.
2017-11-10Fix assert failure when trying to draw empty stringSergey Sharybin
2017-07-08Merge branch 'master' into blender2.8Brecht Van Lommel
2017-07-08Fix T51889: new file or load factory settings results in broken UI.Brecht Van Lommel
Fix some cases that still assumed there to be a global DPI, instead of a per window DPI that needs to be set before reading U.dpi.
2017-06-19Gawain API naming refactorCampbell Barton
Use consistent prefix for gawain API names as well as some abbreviations to avoid over-long names, see: D2678
2017-05-17Silence warnings in Mac (based on buildbot build report)Dalai Felinto
2017-04-20Cleanup: Use explicit unsigned int typeSergey Sharybin
This is as per our code style states ans as majority of the team prefers types to be used.
2017-04-18Fix text drawing with core profileSergey Sharybin
The issue was going to the fact that GL_ALPHA was deprecated in core profile and common solution online is to use GL_RED instead. That is what is done in this commit.
2017-04-15GPU Matrix API: clean up after 2D-3D unificationMike Erwin
See GPU_matrix.h & gpu_matrix.c for the important changes. Other files are mostly just updated to use the latest API. - remove unused functions, defines, enums, comments - remove "3D" from function names - init to Identity transform (otherwise empty stack) - gpuMatrixReset lets outside code return to initial state Part of T49450 Follow up to D2626 and 49fc9cff3b90
2017-04-14Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/alembic/intern/abc_exporter.cc
2017-04-14BLF: avoid glyph cache use-after freeCampbell Barton
Causes crash if the font size isn't set after clearing (see T51200)
2017-04-10Get rid of last PRIM_QUAD usage, in blf_font.c/blf_glyph.c.Bastien Montagne
2017-04-10Make build with GL 3.3 againDalai Felinto
This is a workaround while the PRIM_QUADS_XXX are still in the code
2017-04-07OpenGL: transition away from GL_QUADSMike Erwin
Single quads are drawn as a TRIANGLE_FAN, with 4 verts in the same order. Multiple quads now use PRIM_QUADS_XXX and will need further work. Only 8 places still use this. Part of T49043
2017-04-06Gawain: VertexFormat_add_attrib (function name change)Mike Erwin
See intern/gawain for the API change. Other files are updated to use the new name. Also updated every call site to the recommended style: unsigned int foo = VertexFormat_add_attrib(format, "foo", COMP_ ... )
2017-04-04Immediate Mode: glPop/glPushClientAttribDalai Felinto
2017-03-23cleanup use of GPU matrix APIMike Erwin
Take advantage of 2D functions, rotation about the X Y or Z axis, uniform scale factors. We no longer need to call gpuMatrixBegin_legacy() before using the new API locally in functions. related to T49450
2017-03-22OpenGL: convert to new matrix API (part 5)Mike Erwin
Pretty sure source/blender is now finished, with all legacy matrix calls confined to gpu_matrix.c. This was the easy part, but doing it first makes the next part much easier. TODO and XXX notes describe what is left. glMatrixMode is still in place, since the new API does not share this concept of modes. Similar for glOrtho and glFrustum which I'll tackle very soon. Part of T49450
2017-02-11OpenGL immediate mode: fix Waveform Font colorClément Foucault
2017-02-08Cleanup: warningsCampbell Barton
2017-02-05BLF: simplify API for default fontMike Erwin
We had two versions of several BLF functions -- one for a specific font ID & another for the default font. New BLF_default function lets us simplify this API & delete the redundant code.
2017-02-05add BLF_default functionMike Erwin
So we don't need two versions of all other BLF functions -- one for specific font ID & another for the default font.
2017-02-02fix build: BLF Theme colorMike Erwin
blenderplayer uses BLF but not Editor UI, so we got a link error for the missing UI_GetThemeColor function. Moved the new function from BLF to UI. @Blendify reported problem in IRC
2017-02-02BLF can use Theme colorsMike Erwin
For anything fancier than regular Theme colors (shading, alpha, etc.) do this: unsigned char color[4] UI_GetThemeColor[Fancy]4ubv(... color) BLF_color4ubv(fontid, color) That way the BLF color API stays simple.
2017-02-02set default color for BLF fontsMike Erwin
Set to an annoying bright color so we can see where to add BLF_color calls.
2017-02-02add BLF_color functionsMike Erwin
Needed a way to pass main font color to BLF without using obsolete glColor. Could not use immUniform since BLF binds its shader internally.
2017-01-26Merge branch 'master' into blender2.8Sergey Sharybin
2017-01-26Fix (unreported) crash when file browser attempts to show preview of some ↵IRIE Shinsuke
defective font Confirmed with the Wine's bundled fonts.
2016-10-16Cleanup: Quiet warnings, use RAD2DEG macroJulian Eisel
2016-10-16BLF/OpenGL: more text drawing optimizationMike Erwin
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.
2016-10-16BLF/OpenGL: accurate vertex count for drawingMike Erwin
We still need to BeginAtMost instead of simple Begin, since some glyphs could be clipped & not drawn.
2016-10-16BLF: make blurry text an optional (disabled) featureMike Erwin
While trying to simplify text drawing, noticed no Blender code uses the blur feature. Hopefully scripts don't use it!
2016-10-15BLF: early exit when drawing empty stringsMike Erwin
Avoids all kinds of setup & preparations to draw nothing.
2016-10-15BLF: fix crash on text input fieldsMike Erwin
Some strings have known length, others are NULL terminated (len = INT_MAX in this case). Now font drawing knows to treat INT_MAX special.
2016-10-14OpenGL: draw text with fewer draw callsMike Erwin
Was one draw call per glyph, now one per line. Still room for improvement here.
2016-10-12BLF/OpenGL: use new matrix API when drawing textMike Erwin
First test of matrix API. This will eventually use the 2D part of this API, but the 3D part is ready now. Part of T49450
2016-10-11BLF/OpenGL: draw text with new immediate modeMike Erwin
Part of T49043
2016-09-17OpenGL: streamline font renderingMike Erwin
Ignore texture matrix in the shader, stop messing with texture matrix in BLF code. Use linear screen-space interpolation instead of perspective. Avoid redundant call to glMatrixMode.