filter() does not work after 1.9.0 if noFill() is called
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Topic
filter() was introduced in webgl mode in 1.8.0. At this time, it seems that filter() was still working even with noFill().
// version: 1.8.0
function setup() {
createCanvas(200,200,WEBGL);
}
function draw() {
background(0);
noFill();
stroke(255);
line(-100,-100,300,300);
filter(INVERT);
}
However, since 1.9.0, filter() does not work if noFill() is called. Of course it doesn't work with 1.11.2 either.
It will be drawn when you execute fill().
function setup() {
createCanvas(200,200,WEBGL);
}
function draw() {
background(0);
noFill();
stroke(255);
line(-100,-100,300,300);
fill(255);
filter(INVERT);
}
It seems nonsensical to have to call pointless fill() to filter a sketch that just draws lines.
But I don't know if this is a bug or not.
That's all for raising the issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied WEBGL sketch with filter(), noFill(), and a line in p5.js 1.8.0 and 1.9.0 to confirm the regression. Trace the WebGL paths for filter() and noFill(); done means the filter is applied to a no-fill sketch without requiring a pointless fill() call, with coverage for the reported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100