diff options
author | Alexander Romanov <a.romanov@blend4web.com> | 2015-12-26 00:57:50 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2015-12-27 00:15:23 +0300 |
commit | 700c40e2f9b59b7e780429fdc10fb0d2d5d117a1 (patch) | |
tree | 8a6ed722fba1e652fe9756276c83da3467f396aa /source/blender/blenkernel/intern/editderivedmesh.c | |
parent | 58cf3327e481cea3dbd2c1c0b89b02d4d2ca7be4 (diff) |
OpenGL: stipple support added to basic GLSL shader
The is intended to replace the deprecated glPolygonStipple() calls with a shader
based alternative, once we switch over to GLSL shaders.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D1688
Diffstat (limited to 'source/blender/blenkernel/intern/editderivedmesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/editderivedmesh.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index dc50e39a862..642a89df8e0 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -57,8 +57,7 @@ #include "GPU_glew.h" #include "GPU_shader.h" - -extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */ +#include "GPU_basic_shader.h" static void bmdm_get_tri_colpreview(BMLoop *ls[3], MLoopCol *lcol[3], unsigned char(*color_vert_array)[4]); @@ -804,8 +803,8 @@ static void emDM_drawMappedFaces( if (poly_prev != GL_ZERO) glEnd(); poly_prev = GL_ZERO; /* force glBegin */ - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_quarttone); + GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR); + GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_QUARTTONE); } if (has_vcol_preview) bmdm_get_tri_colpreview(ltri, lcol, color_vert_array); @@ -867,7 +866,7 @@ static void emDM_drawMappedFaces( glEnd(); poly_prev = GL_ZERO; /* force glBegin */ - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } } } @@ -903,8 +902,8 @@ static void emDM_drawMappedFaces( if (poly_prev != GL_ZERO) glEnd(); poly_prev = GL_ZERO; /* force glBegin */ - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_quarttone); + GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR); + GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_QUARTTONE); } if (has_vcol_preview) bmdm_get_tri_colpreview(ltri, lcol, color_vert_array); @@ -968,7 +967,7 @@ static void emDM_drawMappedFaces( glEnd(); poly_prev = GL_ZERO; /* force glBegin */ - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } } } |