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

When nesting active framebuffers, previous framebuffers appear empty when antialiasing is turned on #6313

Closed
1 of 17 tasks
davepagurek opened this issue Aug 2, 2023 · 0 comments · Fixed by #6314
Closed
1 of 17 tasks
Assignees

Comments

@davepagurek
Copy link
Contributor

davepagurek commented Aug 2, 2023

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

p5.js version

1.7.0

Web browser and version

Firefox 114

Operating System

MacOS 12.5.1

Steps to reproduce this

Steps:

  1. Create two framebuffers with antialiasing turned on
  2. Call begin() on the first one to activate it
  3. Draw something to it
  4. Call begin() on the second one to activate it without deactivating the original
  5. Draw the first one to the second with image()
  6. Call end() on both
  7. Draw the second framebuffer to the screen

The image() call does nothing when antialiasing is turned on due to the fact that we only draw the antialiased renderbuffer to the framebuffer texture when end() is called.

Snippet:

createCanvas(200, 200, WEBGL);
setAttributes({ antialias: true })
const fbo1 = createFramebuffer()
const fbo2 = createFramebuffer()

imageMode(CENTER)
noStroke()
fill(0)

fbo1.begin()
circle(0, 0, 40)

fbo2.begin()
image(fbo1, 0, 0)
fbo2.end()

image(fbo2, 30, 30)
fbo1.end()

image(fbo1, 0, 0)

With antialiasing turned on:
image

With antialiasing turned off (expected):
image

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

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

Successfully merging a pull request may close this issue.

1 participant