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
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2014-12-02 02:51:55 +0300
committerJoshua Leung <aligorith@gmail.com>2014-12-02 02:51:55 +0300
commit8b6759a4a99eb76a489f72d749b594410ff2654e (patch)
tree0ecbe297d7dfc5deb82672d0bad282c6c9a844e7 /source
parent0efa41e996aaf1f489e6f8f5395de04d98664834 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 2584f578250..245f22cad1c 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);