Page MenuHome

blender 2.8: OpenGL immediate mode: anim_markers
AbandonedPublic

Authored by Punya Biswal (punya) on Nov 15 2016, 4:23 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Punya Biswal (punya) retitled this revision from to blender 2.8: OpenGL immediate mode: anim_markers.
Punya Biswal (punya) updated this object.
Punya Biswal (punya) set the repository for this revision to rB Blender.

Looks good so far

source/blender/gpu/gawain/immediate.c
746 ↗(On Diff #7806)

FYI We recently switched away from glGetError. Instead run blender --debug-gpu and it will use a debug context & report errors directly.

source/blender/gpu/gawain/immediate.h
82 ↗(On Diff #7806)

Hmmm do we want this? Or redesign calling code to not need this?

Let me think about it some more...

Punya Biswal (punya) edited edge metadata.
Punya Biswal (punya) marked 2 inline comments as done.

Got rid of querying for current color.

source/blender/editors/animation/anim_markers.c
420

This color is for the text drawing (UI_fontstyle_draw_simple). Leave the glColor4fv but get its value with UI_GetThemeColor4fv like you're doing.

Something like this:

float col[4];
UI_GetThemeColor4fv(colorid, col);

#ifdef DURIAN
if (marker->camera ...)
   col[3] = 0.4;
#endif

glColor4fv(col);
492

Have you tried to run this? I don't expect it to work.

draw_marker does 3 things right now:

  • draw marker line
  • draw icon
  • draw text label

The icon and text label each use their own shader program, and will conflict with 2D_UNIFORM_COLOR used for the lines.

If you separate the line drawing into its own function we can draw all lines within one immBegin/End. Which is good! Would have to repeat this loop -- once for lines, again for "other" stuff.

Punya Biswal (punya) marked 2 inline comments as done.

Addressed review comments.

Uniform -> Flat shader for marker lines.

@Mike Erwin (merwin) is this ready to land?

source/blender/gpu/gawain/immediate.c
746 ↗(On Diff #7806)

Got rid of these changes.

source/blender/gpu/gawain/immediate.h
82 ↗(On Diff #7806)

Redesigned to get rid of this call.

This is inactive for far too long. I like what the refactor proposes (splitting the marker drawing in different functions), but I went to the simplest (inefficient) approach first. See rB9151f12d

If @Punya Biswal (punya) is willing to update the patch to the latest code (expect conflicts, since I went over a similar approach) we can re-open this, and eventually apply the more elegant approach the patch was going after.

That said, I find it overkill. The "lines" which were drawn were only for the markers which have cameras bound to it (Ctr+B). Which doesn't present a critical problem. We may not get any real benefit from it. @Mike Erwin (merwin) thoughts?