Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[p5.js 2.0 Beta Bug Report]: Sketches using lighting cause framebuffer feedback bug #7665

Closed
1 of 17 tasks
davepagurek opened this issue Mar 25, 2025 · 0 comments
Closed
1 of 17 tasks

Comments

@davepagurek
Copy link
Contributor

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
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0 beta 5

Web browser and version

Firefox

Operating system

MacOS

Steps to reproduce this

Steps:

  1. Create a framebuffer
  2. Turn on lighting (e.g. ambientLight(100)
  3. Draw something
  4. Draw that framebuffer to the main canvas

Instead of drawing, you get this console error:

WebGL warning: drawElementsInstanced: Texture level 0 would be read by TEXTURE_2D unit 2, but written by framebuffer attachment COLOR_ATTACHMENT0, which would be illegal feedback.

Snippet:

let layer;
function setup() {
  createCanvas(200, 200, WEBGL);
  layer = createFramebuffer();
}
function draw() {
  noStroke();
 
  layer.begin();
  background(255)
  fill(0)
  ambientLight(100); // comment out to make it work
  circle(0,0,40)  layer.end();


  // Visualize either the color or the depth
  push();
  if (mouseIsPressed) {
    texture(layer.depth);
  } else {
    texture(layer.color);
  }
  plane(width, height);
  pop();
}

Live: https://editor.p5js.org/davepagurek/sketches/MFZRK8RBe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant