Skip to content
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

Fix for fill artifact in WebGL mode when rendering in LINE mode using beginShape #6827

Merged
Merged
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
4 changes: 3 additions & 1 deletion src/webgl/p5.RendererGL.Immediate.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ p5.RendererGL.prototype.endShape = function(

// LINE_STRIP and LINES are not used for rendering, instead
// they only indicate a way to modify vertices during the _processVertices() step
let is_line = false;
if (
this.immediateMode.shapeMode === constants.LINE_STRIP ||
this.immediateMode.shapeMode === constants.LINES
) {
this.immediateMode.shapeMode = constants.TRIANGLE_FAN;
is_line = true;
}

// WebGL doesn't support the QUADS and QUAD_STRIP modes, so we
Expand All @@ -239,7 +241,7 @@ p5.RendererGL.prototype.endShape = function(
this.immediateMode.shapeMode = constants.TRIANGLE_STRIP;
}

if (this._doFill) {
if (this._doFill && !is_line) {
if (
!this.geometryBuilder &&
this.immediateMode.geometry.vertices.length >= 3
Expand Down
Loading