Skip to content

Support shader-based filters after resizing/changing pixel density #6399

Closed
@davepagurek

Description

@davepagurek

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

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:

  1. Create a canvas and apply a filter without using CPU mode
  2. Resize the canvas
  3. Apply another filter without using CPU mode

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:
image

Snippet:

createCanvas(20, 20)

clear()
circle(50,50,50)
filter(BLUR, 3)

resizeCanvas(100, 100)

clear()
circle(50,50,50)
filter(BLUR, 3) // works if you add `false` as a 3rd argument

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    DONE! 🎉

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions