diff --git a/src/webgl/p5.RendererGL.js b/src/webgl/p5.RendererGL.js index 3e672fa3d4..a0aa5391dd 100755 --- a/src/webgl/p5.RendererGL.js +++ b/src/webgl/p5.RendererGL.js @@ -123,7 +123,7 @@ p5.RendererGL = function(elt, pInst, isMainCanvas, attr) { this.fill(255, 255, 255, 255); //this.stroke(0, 0, 0, 255); this.pointSize = 5.0; //default point size - this.strokeWeight(2); + this.strokeWeight(1); this.stroke(0, 0, 0); // array of textures created in this gl context via this.getTexture(src) this.textures = []; diff --git a/src/webgl/shaders/line.vert b/src/webgl/shaders/line.vert index 4fee2ab029..cd6a48bba8 100644 --- a/src/webgl/shaders/line.vert +++ b/src/webgl/shaders/line.vert @@ -23,7 +23,11 @@ uniform mat4 uProjectionMatrix; uniform float uStrokeWeight; uniform vec4 uViewport; -vec3 scale = vec3(1.0); + +// using a scale <1 moves the lines towards the camera +// in order to prevent popping effects due to half of +// the line disappearing behind the geometry faces. +vec3 scale = vec3(0.9995); attribute vec4 aPosition; attribute vec4 aDirection;