From 700c40e2f9b59b7e780429fdc10fb0d2d5d117a1 Mon Sep 17 00:00:00 2001 From: Alexander Romanov Date: Fri, 25 Dec 2015 22:57:50 +0100 Subject: 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 --- source/blender/blenkernel/intern/subsurf_ccg.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c') diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 53da38b2da8..f16ef3df6be 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -77,6 +77,7 @@ #include "GPU_glew.h" #include "GPU_buffers.h" #include "GPU_shader.h" +#include "GPU_basic_shader.h" #include "CCGSubSurf.h" @@ -87,8 +88,6 @@ /* assumes MLoop's are layed out 4 for each poly, in order */ #define USE_LOOP_LAYOUT_FAST -extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */ - static ThreadRWMutex loops_cache_rwlock = BLI_RWLOCK_INITIALIZER; static ThreadRWMutex origindex_cache_rwlock = BLI_RWLOCK_INITIALIZER; @@ -3652,8 +3651,8 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, if (draw_option != DM_DRAW_OPTION_SKIP) { if (draw_option == DM_DRAW_OPTION_STIPPLE) { - 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); } /* no need to set shading mode to flat because @@ -3752,7 +3751,7 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, } } if (draw_option == DM_DRAW_OPTION_STIPPLE) - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } } } -- cgit v1.2.3