Skip to content

[p5.js 2.0 Bug Report]: WebGPU: antialias controls don't quite work like in WebGL #8482

@davepagurek

Description

@davepagurek

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

Latest dev-2.0 build

Web browser and version

Chrome

Operating system

All

Steps to reproduce this

In WebGPU, we now only draw to a main framebuffer when it's necessary -- e.g. for a filter shader or when reading back/saving pixels. Currently, the main framebuffer is antialiased but the main canvas is not, so that we aren't unnecessarily double-antialiasing when we draw it to the main canvas at the end of a frame. However, if we are drawing directly to the main canvas before that, those drawn shapes will not be antialiased. Also, I don't believe setAttributes works yet in WebGPU, which in WebGL is how you can decide whether the main canvas should be antialiased or not.

So the task here would be:

  • Support setAttributes({ antialias: true }) (or false)
  • If antialiasing is enabled, antialias the main canvas only when drawing directly to it, and not when drawing the main framebuffer back to it

Note that this is a quite complex system to jump into, so while this is open for contribution, this is not a great first issue if you're just getting started.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions