You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Erase something from the frame buffer by drawing a shape using erase()
Draw the frame buffer to the canvas and watch as the parts of the frame buffer meant to still have colors get turned transparent through the canvas and the transparent area including the part that was meant to be erased turn into the background color of the canvas.
Snippet:
letb;functionsetup(){createCanvas(400,400,WEBGL);b=createFramebuffer();}functiondraw(){background(0);b.begin(){fill(255,0,0)noStroke()rect(-100,-100,200,200)erase()// This is Erasing the Main Canvas, rather than the framebuffercircle(0,0,100)noErase()}b.end()image(b,-200,-200)}
Related to issue #6523 where erase() wouldn't work at all. It was originally fixed, but in versions past 1.9.0 it's now broken in the way described above instead of no longer functioning.
The text was updated successfully, but these errors were encountered:
Most appropriate sub-area of p5.js?
p5.js version
1.9.1+
Web browser and version
Firefox 133.0.3 & Chromium 131.0.6778.85
Operating system
Debian 12
Steps to reproduce this
Steps:
erase()
Snippet:
Related to issue #6523 where
erase()
wouldn't work at all. It was originally fixed, but in versions past1.9.0
it's now broken in the way described above instead of no longer functioning.The text was updated successfully, but these errors were encountered: