Mercurial > hg > octave-nkf
diff libinterp/corefcn/gl-render.cc @ 18853:8969bd721448
Fix Z-depth issues of patches and lines in 2-D plots (bug #40722).
* gl-render.cc (draw_patch): Call patch_tesselator constructor with
a negative Z-offset for glPolygonOffset to pull it forward of line objects
at Z=0.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 29 Apr 2014 11:39:58 -0700 |
parents | 44f0d1a53ead |
children | ea22cf3e370b |
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc +++ b/libinterp/corefcn/gl-render.cc @@ -2278,7 +2278,7 @@ Matrix vv (1, 3, 0.0); Matrix cc; - Matrix nn(1, 3, 0.0); + Matrix nn (1, 3, 0.0); double aa = 1.0; vv(0) = v(idx,0); vv(1) = v(idx,1); @@ -2339,7 +2339,10 @@ glEnable (GL_LIGHTING); // FIXME: use __index__ property from patch object - patch_tesselator tess (this, fc_mode, fl_mode, 0); + // -1.25 chosen to provide sufficient Z-offset for + // 'layer' property of 2-D plots and not to provoke + // Z-fighting with tesselator outline. + patch_tesselator tess (this, fc_mode, fl_mode, -1.25); for (int i = 0; i < nf; i++) {