[Bf-blender-cvs] [8b6759a] master: GPencil Drawing: Enable polygon smoothing
Joshua Leung
noreply at git.blender.org
Tue Dec 2 01:53:00 CET 2014
Commit: 8b6759a4a99eb76a489f72d749b594410ff2654e
Author: Joshua Leung
Date: Tue Dec 2 12:51:55 2014 +1300
Branches: master
https://developer.blender.org/rB8b6759a4a99eb76a489f72d749b594410ff2654e
GPencil Drawing: Enable polygon smoothing
This helps to reduce jaggies from thin lines, while also resulting in nicer
lines elsewhere.
I'm not sure if it's just me, but it seems to render slightly differently to
before for 3d strokes too (i.e. they seem a bit softer). Hopefully the
difference isn't big enough to affect/degrade the art style of any projects.
===================================================================
M source/blender/editors/gpencil/drawgpencil.c
===================================================================
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 2584f57..245f22c 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -957,6 +957,9 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
/* turn on smooth lines (i.e. anti-aliasing) */
glEnable(GL_LINE_SMOOTH);
+ glEnable(GL_POLYGON_SMOOTH);
+ glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
+
/* turn on alpha-blending */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
@@ -1055,6 +1058,7 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
/* turn off alpha blending, then smooth lines */
glDisable(GL_BLEND); // alpha blending
glDisable(GL_LINE_SMOOTH); // smooth lines
+ glDisable(GL_POLYGON_SMOOTH); // smooth poly lines
/* restore initial gl conditions */
glLineWidth(1.0);
More information about the Bf-blender-cvs
mailing list