Smaller displacement for lines (issue #1790)

This commit is contained in:
codeanticode
2013-05-22 11:04:30 -04:00
parent 97801ac575
commit dea8e9dd16
2 changed files with 7 additions and 2 deletions

View File

@@ -125,6 +125,10 @@ public class PGL {
/** Minimum array size to use arrayCopy method(). **/
protected static final int MIN_ARRAYCOPY_SIZE = 2;
/** Factor used to displace the stroke vertices towards the camera in
* order to make sure the lines are always on top of the fill geometry **/
protected static final float STROKE_DISPLACEMENT = 0.999f;
/** JOGL's windowing toolkit */
// The two windowing toolkits available to use in JOGL:
protected static final int AWT = 0; // http://jogamp.org/wiki/index.php/Using_JOGL_in_AWT_SWT_and_Swing

View File

@@ -7149,10 +7149,11 @@ public class PGraphicsOpenGL extends PGraphics {
if (pgCurrent.getHint(DISABLE_OPTIMIZED_STROKE)) {
setUniformValue(scaleLoc, 1.0f, 1.0f, 1.0f);
} else {
float f = PGL.STROKE_DISPLACEMENT;
if (orthoProjection()) {
setUniformValue(scaleLoc, 1.0f, 1.0f, 0.99f);
setUniformValue(scaleLoc, 1, 1, f);
} else {
setUniformValue(scaleLoc, 0.99f, 0.99f, 0.99f);
setUniformValue(scaleLoc, f, f, f);
}
}