Skip to content

Fix 3d stroke #2657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/webgl/p5.RendererGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
6 changes: 5 additions & 1 deletion src/webgl/shaders/line.vert
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down