-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
noSmooth() makes textures with NEAREST interpolation blurry #6325
Comments
Same for me after checking. |
Oh I think I know what's going on here. For now, calling |
Ah, alr |
Hi! I went through the existing discussions on this issue and similar ones. I was thinking if making these changes would solve the issue? p5.prototype.noSmooth = function() {
if (!this._renderer.isP3D) {
if ('imageSmoothingEnabled' in this.drawingContext) {
this.drawingContext.imageSmoothingEnabled = false;
}
} else {
const currentRenderer = this._renderer;
if (this._renderer !== currentRenderer) {
this._renderer.parent = this;
this._renderer.drawingContext = this.drawingContext;
}
}
return this;
}; This would avoid canvas recreation, reassigning current renderer's parent and drawing context. |
I think unfortunately if we need to change the attributes of the canvas, we need to recreate the canvas, since MDN says:
...but that said, your idea of updating the properties of old renderer objects could be a good approach to fixing #5902! I would probably do it in
That said, although this is necessary for |
Most appropriate sub-area of p5.js?
p5.js version
1.7.0
Web browser and version
115.0.5790.111
Operating System
Windows 10
Steps to reproduce this
Steps:
noSmooth()
Snippet:
In case you don't want to copy and paste it here's the sketch: https://editor.p5js.org/PotatoBoy/sketches/vgaD3vTok
The text was updated successfully, but these errors were encountered: