diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-03-18 03:55:41 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-03-18 03:56:34 +0300 |
commit | 4137f30928dcfda4539d3d80df2c3e079eed12ec (patch) | |
tree | b5b7fb2cef587ea9c2cdd5789350d42b3f71a9ce /source/blender/draw/intern/draw_view.c | |
parent | cddde85f2c5f25f3672a9c985b5174b19670e7af (diff) |
Object Mode: Add stencil test to remove object outlines inside the silouhette.
It also adds nice occluded silouhette information for selected objects that are behind visible objects.
This methods is really heavy because it needs to render the wires twices.
Diffstat (limited to 'source/blender/draw/intern/draw_view.c')
-rw-r--r-- | source/blender/draw/intern/draw_view.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 4d813124118..747cc84a9cd 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -549,12 +549,13 @@ void DRW_draw_background(void) /* Just to make sure */ glDepthMask(GL_TRUE); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + glStencilMask(0xFF); if (UI_GetThemeValue(TH_SHOW_BACK_GRAD)) { /* Gradient background Color */ gpuMatrixBegin3D(); /* TODO: finish 2D API */ - glClear(GL_DEPTH_BUFFER_BIT); + glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); VertexFormat *format = immVertexFormat(); unsigned pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); @@ -583,7 +584,7 @@ void DRW_draw_background(void) else { /* Solid background Color */ UI_ThemeClearColorAlpha(TH_HIGH_GRAD, 1.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); } } |