processing / processing/p5.js

Warning being logged in Safari when using a filter shader in 2D mode

Open
#6,597 9 comments 0 reactions 1 assignee View on GitHub

@sproutleaf is already working on this.

Since Jul 5, 2024.

Area:WebGL Bug Friendly Errors
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:
  1. Create a custom filter with createFilterShader
  2. Create a 2D mode canvas
  3. Use the filter shader on it

On safari this warning gets logged:
image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.