Warning being logged in Safari when using a filter shader in 2D mode
@sproutleaf is already working on this.
Since Jul 5, 2024.
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
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
1.9.0
Web browser and version
Safari 17.0
Operating System
MacOS 14
Steps to reproduce this
Steps:
- Create a custom filter with
createFilterShader - Create a 2D mode canvas
- Use the filter shader on it
On safari this warning gets logged:
Weirdly, this doesn't happen in Chrome/Firefox, but honestly I'm not sure why it doesn't. It seems to be happening because when we call copy() to copy the 2D mode contents to the filter graphic, we're passing in the p5.Renderer2D as the source:
https://github.com/processing/p5.js/blob/37d3324b457b177319ed65468201f2806a66eff5/src/image/pixels.js#L602
Technically we do not validate p5.Renderer as a valid input for texture. Maybe we should?
Snippet:
See the bouncing balls section of this sketch: https://openprocessing.org/sketch/2107682
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.
Assessment
This issue has not been assessed yet.