diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-01-16 06:59:42 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-01-16 07:51:29 +0300 |
commit | 2d71d13ea2cb7a7640e5139dc24341bd58416d57 (patch) | |
tree | 48061a6f98f4212de685e3dc8279270a5427e898 /source/blender/editors/space_view3d/drawarmature.c | |
parent | 31375a1b21a98f5ce6abdd46a41a1e287d3d5050 (diff) |
OpenGL: fixes related to GL_POINTS
I put all usage of GL_POINTS under the microscope. Fixed problems &
optimized a couple of spots.
- reduce calls to glPointSize by about 50%
- draw selected & unselected vertices together for UV editor & EditMesh
- draw initial gpencil stroke point the proper size
- a few other smaller fixes
New policy: each GL_POINTS draw call needs to set its desired point
size. This eliminates half our calls to glPointSize (setting it back to
its 1.0 default after every draw).
Diffstat (limited to 'source/blender/editors/space_view3d/drawarmature.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index e35c70048e7..6a3e8f242be 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1000,6 +1000,12 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned /* this chunk not in object mode */ if (armflag & (ARM_EDITMODE | ARM_POSEMODE)) { glLineWidth(4.0f); + if (G.f & G_PICKSEL) { + /* no bitmap in selection mode, crashes 3d cards... + * instead draw a solid point the same size */ + glPointSize(8.0f); + } + if (armflag & ARM_POSEMODE) set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); else if (armflag & ARM_EDITMODE) { @@ -1008,7 +1014,7 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned /* Draw root point if we are not connected */ if ((boneflag & BONE_CONNECTED) == 0) { - if (G.f & G_PICKSEL) { /* no bitmap in selection mode, crashes 3d cards... */ + if (G.f & G_PICKSEL) { GPU_select_load_id(id | BONESEL_ROOT); glBegin(GL_POINTS); glVertex3f(0.0f, 0.0f, 0.0f); @@ -2587,7 +2593,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) /* ********************************** Armature Drawing - Main ************************* */ -/* called from drawobject.c, return 1 if nothing was drawn +/* called from drawobject.c, return true if nothing was drawn * (ob_wire_col == NULL) when drawing ghost */ bool draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, const short dt, const short dflag, const unsigned char ob_wire_col[4], |