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
Between the framebuffer's begin/end, apply a different clip
After the end of the framebuffer, draw something else to the main canvas
After (5), the main canvas's clip is no longer active. We intentionally only support one clip at a time per draw target for now (because saving + restoring a stencil buffer might be slow) but we should be able to support switching between framebuffers like this.
Snippet:
letfbofunctionsetup(){createCanvas(400,400,WEBGL)fbo=createFramebuffer()noLoop()}functiondraw(){rectMode(CENTER)background('red')push()beginClip()rect(-25,-25,100,100)endClip()fbo.begin()beginClip()rect(25,25,100,100)endClip()fill('blue')rect(0,0,width,height)fbo.end()imageMode(CENTER)image(fbo,0,0)pop()// Visualize outlines of masksnoFill()rect(-25,-25,100,100)rect(25,25,100,100)}
Most appropriate sub-area of p5.js?
p5.js version
main branch
Web browser and version
Firefox 114
Operating System
MacOS 12.5.1
Steps to reproduce this
Steps:
begin
/end
, apply a different clipend
of the framebuffer, draw something else to the main canvasAfter (5), the main canvas's clip is no longer active. We intentionally only support one clip at a time per draw target for now (because saving + restoring a stencil buffer might be slow) but we should be able to support switching between framebuffers like this.
Snippet:
Live: https://editor.p5js.org/davepagurek/sketches/ZfeKjEE0I
Expected:
Actual:
The text was updated successfully, but these errors were encountered: