-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Support shader-based filters after resizing/changing pixel density #6399
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
Comments
I believe changing the pixel density will also have similar effects, so I'm updating the title of the issue to include that too. |
Good catch! @wong-justin do you want to take a look at this? |
Yes I'll have a look. Thanks @davepagurek for catching it |
Currently, we create a new filter shader graphic if one does not yet exist here, matching the main canvas's size and density: p5.js/src/webgl/p5.RendererGL.js Lines 982 to 998 in 3d62084
However, once it has been made, we never check if it needs to be resized. I think to fix this, we can add an |
do you think this looks good. I think we can have the |
Thanks, @Gaurav-1306, that looks good!
Agreed, that works! |
Most appropriate sub-area of p5.js?
p5.js version
main branch
Web browser and version
Firefox 117
Operating System
MacOS 12.5.1
Steps to reproduce this
Note: this is a follow up to the conversation on #6324
The feature works great so far! This is just another edge case that we can try to clean up for more robustness.
Steps:
It looks like only the size of the previous canvas is getting rendered, and rendering appears to break. In this example, the top left square is the size of the canvas pre-resize:

Snippet:
Live: https://editor.p5js.org/davepagurek/sketches/EwgqqaiDI
The text was updated successfully, but these errors were encountered: