-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Per-polygon fills in 2D mode #7722
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
Comments
Hi @davepagurek Could you please take a look when you get a chance? I'd really appreciate your feedback! |
Thanks @LalitNarayanYadav. Your PR is filed against the In 1.x this feature already works, so we don't need an implementation/PR for the I hope that made sense. |
Thanks for the clarification, @limzykenneth! That makes sense now—I misunderstood the target branch for this feature. Would you recommend that I rebase and submit the PR against the dev-2.0 branch instead? If there are any specific guidelines or differences I should be aware of when implementing this in 2.0, I’d really appreciate any pointers. Looking forward to your feedback! |
The main branch and the dev-2.0 branch have diverge significantly especially in the vertex section that this issue relates to, which means rebase is not recommended. Starting from the The implementation is potentially very different in |
Increasing access
This is a thing in WebGL so getting as close to this as possible in 2D can help with consistency.
Most appropriate sub-area of p5.js?
Feature enhancement details
In 2D mode, a limitation of the base canvas API is that every shape drawn can only have one color.
While we advertised one color per shape in 2D mode, in 1.x, some of the shape modes used to draw multiple shapes under the hood, including TRIANGLE_STRIP. Our initial shape implementation for 2.0 assumes that every shape in 2D mode is just one color, but we could in theory put this back for
TRIANGLES
,TRIANGLE_STRIP
,QUAD_STRIP
, andQUADS
modes. (Unlike WebGL, it will not interpolate between vertices, but we can still change color per polygon.) We likely will want to continue to render the full thing as one shape for performance if the color does not change.The text was updated successfully, but these errors were encountered: