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
If one calls texture() in between a push and a pop, after the pop, the texture is still bound to the shader's uSampler uniform.
Normally, this isn't a problem, since we pass false to isTexture, and the shader doesn't try to read the texture. However, if you draw to one texture, then use that texture on a plane onto the main canvas, the browser complains that there is illegal feedback and does not render any fill. This is avoided if you use multiple canvases instead of framebuffers (the default in p5), but this becomes an issue if using framebuffers within the same WebGL context for performance reasons.
e.g. on Chrome:
GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture.
e.g. on Firefox:
WebGL warning: drawElementsInstanced: Texture level 0 would be read by TEXTURE_2D unit 0, but written by framebuffer attachment COLOR_ATTACHMENT0, which would be illegal feedback.
Here's some code that renders to a framebuffer and triggers this issue (calling lights() results in the above warning and no fills rendered):
Because this doesn't affect vanilla p5, it isn't a huge issue, but unbinding the texture is a small change that lets us move towards potentially using framebuffers in the future for WebGL filters.
The text was updated successfully, but these errors were encountered:
Most appropriate sub-area of p5.js?
p5.js version
1.5.0
Web browser and version
Firefox 107.0
Operating System
MacOS 12.5.1
Steps to reproduce this
If one calls
texture()
in between apush
and apop
, after thepop
, the texture is still bound to the shader'suSampler
uniform.Normally, this isn't a problem, since we pass
false
toisTexture
, and the shader doesn't try to read the texture. However, if you draw to one texture, then use that texture on a plane onto the main canvas, the browser complains that there is illegal feedback and does not render any fill. This is avoided if you use multiple canvases instead of framebuffers (the default in p5), but this becomes an issue if using framebuffers within the same WebGL context for performance reasons.e.g. on Chrome:
e.g. on Firefox:
Here's some code that renders to a framebuffer and triggers this issue (calling
lights()
results in the above warning and no fills rendered):Live: https://editor.p5js.org/davepagurek/sketches/3Qmz-9PZx
Because this doesn't affect vanilla p5, it isn't a huge issue, but unbinding the texture is a small change that lets us move towards potentially using framebuffers in the future for WebGL filters.
The text was updated successfully, but these errors were encountered: