Skip to content

[p5.js 2.0+ Bug Report]: Fill interpolation in TRIANGLE_FAN broke between 2.1.2 and 2.2.0 #8972

Description

@davepagurek

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • WebGPU
  • p5.strands
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.2.0+

Web browser and version

Firefox

Operating system

MacOS

Steps to reproduce this

Steps:

  1. Create a WebGL canvas
  2. Create a triangle fan with separate fills in the center and radial vertices

Here's what we get on p5 2.2.0+:

Image

Here's what 2.1.2 looked like:

Image

Snippet:

function setup() {
  createCanvas(400, 400, WEBGL);
  beginShape(TRIANGLE_FAN)
  fill(0)
  vertex(0, 0)
  fill(255)
  let n = 10
  let r = 100
  for (let i = 0; i <= n; i++) {
    const angle = i/n * TWO_PI
    vertex(r*cos(angle), r*sin(angle))
  }
  endShape()
}

Live: https://editor.p5js.org/davepagurek/sketches/QEYON0ddE

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions