-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
filter() does not work after 1.9.0 if noFill() is called #7425
Comments
hi, i checked it in the web editor, and it seems actually pointless to call the fill() unneccessary. i will be working on this then just let me know that you get this bug in the p5.js web editor? |
here: noFill_filter_BUG noFill() and no "fill()"function setup() {
createCanvas(400, 400, WEBGL);
rotateX(PI/4);
rotateY(PI/4);
noFill();
stroke(255);
background(0);
box(200);
filter(INVERT);
} noFill() and "fill()"function setup() {
createCanvas(400, 400, WEBGL);
rotateX(PI/4);
rotateY(PI/4);
noFill();
stroke(255);
background(0);
box(200);
fill("aquamarine");
filter(INVERT);
} |
yes, if nofill() is given then giving fill() is uneccesary, thanks for noticing it. will work on this |
Thank you for your working on this issue. I'm not familiar with the behavior around filter() and framebuffer, so I can't work for this issue. |
its all good, no worries 😊 |
Just a heads up -- In the |
alright, then according to your insights, the code should be like this:
please correct me if im wrong |
Is someone working on this? If not I'd like to proceed on this. p5.prototype.noFill = function() {
this._renderer.states.fillColor = this.color(255, 255, 255, 0);
return this;
}; |
There's a performance (and depth ordering) implication to having fill set, since we have to triangulate all the faces in order to fill them, and then it has an entry in the depth buffer, preventing farther-away objects from being drawn at those pixels. So I think we still want to avoid doing fills at all if |
Topic
filter() was introduced in webgl mode in 1.8.0. At this time, it seems that filter() was still working even with noFill().
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().
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.
The text was updated successfully, but these errors were encountered: