-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- p5.strands
- WebGL
- DevOps, Build process, Unit testing
- Internationalization (i18n)
- Friendly Errors
- Other (specify if possible)
p5.js version
v2.2.1 and v2.2.2-rc.2 (reproduces in both)
Web browser and version
Google Chrome 145.0.7632.75 (Official Build, 64-bit)
Operating system
Linux Ubuntu 24.04 LTS
Steps to reproduce this
- Create a WebGL canvas.
- Create a secondary createGraphics() buffer in WEBGL mode.
- Draw a shape on the graphics buffer.
- Call filter() on the graphics buffer.
The sketch crashes with a TypeError
Snippet:
function setup() {
createCanvas(100, 100, WEBGL);
const g = createGraphics(100, 100, WEBGL);
g.noStroke();
g.fill('red');
g.circle(0, 0, 40);
g.filter(INVERT); // crashes
}Console Error:
Uncaught (in promise) TypeError: e.getColor is not a function
at _makeFilterShader (p5.min.js)
at filter (p5.min.js)
at Graphics.filter
Calling filter() on a createGraphics(WEBGL) renderer causes a runtime TypeError originating inside the WebGL filter shader pipeline.
Reactions are currently unavailable