Age | Commit message (Collapse) | Author |
|
|
|
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.
|
|
Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678
|
|
|
|
This is as per our code style states ans as majority of the team
prefers types to be used.
|
|
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.
|
|
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
|
|
Conflicts:
source/blender/alembic/intern/abc_exporter.cc
|
|
Causes crash if the font size isn't set after clearing (see T51200)
|
|
|
|
This is a workaround while the PRIM_QUADS_XXX are still in the code
|
|
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
|
|
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_ ... )
|
|
|
|
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
|
|
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
|
|
|
|
|
|
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.
|
|
So we don't need two versions of all other BLF functions -- one for specific font ID & another for the default font.
|
|
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
|
|
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.
|
|
Set to an annoying bright color so we can see where to add BLF_color calls.
|
|
Needed a way to pass main font color to BLF without using obsolete glColor. Could not use immUniform since BLF binds its shader internally.
|
|
|
|
defective font
Confirmed with the Wine's bundled fonts.
|
|
|
|
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!
|
|
Avoids all kinds of setup & preparations to draw nothing.
|
|
Some strings have known length, others are NULL terminated (len = INT_MAX in this case).
Now font drawing knows to treat INT_MAX special.
|
|
Was one draw call per glyph, now one per line.
Still room for improvement here.
|
|
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
|
|
Part of T49043
|
|
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.
|
|
With USE_GLSL enabled, GPU_basic_shader(TEXTURE|COLOR) always rendered black. New shader uses a solid color + alpha channel of texture (which in our case is a font glyph). See fragment shader for details.
I prefer this approah -- multiple shaders that each do one thing well (and are easy to read/write/understand), instead of one shader that can do many things given the right options.
|
|
Assigning within a conditional is confusing and error prone so I
rewrote in a more straightforward way.
Found with PVS-Studio T48917
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
Caused odd white space error in tooltip enum values.
|
|
|
|
Following up on recent double --> float commits in the game engine.
|
|
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.
|
|
|