Skip to content

Updating the docs for triangle_strip #848

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

Merged
merged 1 commit into from
May 23, 2025
Merged

Conversation

perminder-17
Copy link
Contributor

Hi @ksen0 and @davepagurek,

The example in the docs now renders as a single solid colour instead of a rainbow because of p5 issue #7722.
In p5 1.x, modes such as TRIANGLES, TRIANGLE_STRIP, QUAD_STRIP, and QUADS quietly split the geometry into many sub-shapes, so you could call fill() between vertex() calls and get different colours per polygon. The new 2-D shape engine in 2.0 treats each beginShape()/endShape() block as one path and therefore locks it to the initial fill/stroke. A future fix will probably restore per-polygon colouring for those modes (without interpolation, unlike WebGL) while keeping the single-colour fast path when the style doesn’t change.

Until that enhancement lands, the simplest way to keep the rainbow example working is to run it on a WEBGL canvas; WebGL still supports per-vertex colours. I’ve updated the PR accordingly so users won’t be puzzled by a solid-red ring in the docs. Once processing/p5.js#7722 is resolved on dev-2.0, we can switch the example back to the standard 2-D renderer.

Copy link
Collaborator

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@davepagurek davepagurek merged commit 28e75da into 2.0 May 23, 2025
4 checks passed
@davepagurek davepagurek deleted the perminder-17-patch-1 branch May 23, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants